Jordan Crouse
88b333b0ed
drm/msm: Ensure that the hardware write pointer is valid
...
Currently the value written to CP_RB_WPTR is calculated on the fly as
(rb->next - rb->start). But as the code is designed rb->next is wrapped
before writing the commands so if a series of commands happened to
fit perfectly in the ringbuffer, rb->next would end up being equal to
rb->size / 4 and thus result in an out of bounds address to CP_RB_WPTR.
The easiest way to fix this is to mask WPTR when writing it to the
hardware; it makes the hardware happy and the rest of the ringbuffer
math appears to work and there isn't any point in upsetting anything.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
[squash in is_power_of_2() check]
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-12-29 15:02:58 -05:00
..
2016-12-23 05:25:12 +10:00
2016-12-06 10:26:48 +01:00
2016-12-05 17:11:48 +10:00
2016-12-14 16:04:09 -08:00
2016-12-18 14:39:50 +01:00
2016-11-02 11:33:47 -04:00
2016-12-01 10:05:53 -05:00
2016-12-07 08:27:36 +05:30
2016-12-01 10:05:53 -05:00
2016-12-14 16:04:09 -08:00
2016-12-14 16:04:09 -08:00
2016-12-09 12:43:17 +10:00
2016-12-14 16:04:09 -08:00
2016-12-01 10:05:53 -05:00
2016-11-18 00:00:40 +00:00
2016-11-02 11:33:47 -04:00
2016-12-23 05:28:02 +10:00
2016-12-06 10:26:48 +01:00
2016-12-06 10:26:48 +01:00
2016-12-01 10:07:20 +01:00
2016-12-01 10:05:53 -05:00
2016-12-29 15:02:58 -05:00
2016-12-08 10:25:37 +10:00
2016-12-13 14:29:05 +10:00
2016-12-14 16:04:09 -08:00
2016-12-06 17:06:32 +01:00
2016-12-06 10:26:48 +01:00
2016-12-22 14:34:24 +01:00
2016-12-01 10:05:53 -05:00
2016-12-01 10:05:53 -05:00
2016-11-02 11:33:47 -04:00
2016-12-01 10:05:53 -05:00
2016-11-02 11:33:47 -04:00
2016-12-01 10:05:53 -05:00
2016-12-06 10:26:48 +01:00
2016-11-02 11:33:47 -04:00
2016-12-14 16:04:09 -08:00
2016-12-06 10:26:48 +01:00
2016-12-14 16:04:09 -08:00
2016-12-14 16:04:09 -08:00
2016-12-13 12:05:12 +10:00
2016-12-14 16:04:09 -08:00
2016-11-02 11:33:47 -04:00
2016-12-15 06:59:17 +02:00
2016-12-02 17:15:20 +01:00
2016-11-15 11:00:42 +01:00
2016-12-06 16:28:30 -02:00
2016-12-13 12:05:12 +10:00
2016-11-15 22:39:48 +01:00
2016-11-18 09:45:07 +01:00
2016-12-07 11:16:55 -02:00
2016-12-07 11:16:55 -02:00
2016-11-21 13:22:08 -05:00
2016-12-10 22:46:19 +01:00
2016-11-15 12:51:49 +01:00
2016-11-30 14:28:20 +10:00
2016-11-29 23:34:36 +01:00
2016-11-14 12:43:58 +01:00
2016-11-29 15:52:32 -05:00
2016-11-02 11:33:47 -04:00
2016-11-12 14:19:38 +01:00
2016-11-17 11:58:09 +01:00
2016-11-15 23:33:48 +01:00
2016-12-08 10:00:15 +01:00
2016-11-15 23:33:48 +01:00
2016-11-28 08:39:41 +01:00
2016-12-01 10:35:45 +01:00
2016-11-16 14:36:27 +01:00
2016-11-15 15:01:42 +01:00
2016-11-17 11:59:26 +01:00
2016-11-29 23:34:36 +01:00
2016-11-08 16:38:03 -05:00
2016-12-09 12:29:10 +10:00
2016-12-08 10:29:22 +01:00
2016-11-15 12:55:24 +01:00
2016-12-06 13:41:15 +01:00
2016-11-28 08:12:18 +01:00
2016-11-08 16:38:03 -05:00
2016-12-14 16:04:09 -08:00
2016-12-08 10:35:52 +10:00
2016-12-08 10:35:52 +10:00