summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/udl/udl_transfer.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-11-01 03:47:09 (GMT)
committerDave Airlie <airlied@redhat.com>2012-11-02 00:31:37 (GMT)
commit3916e1d71b62b120888aa50bcc8d9a6200fc19a7 (patch)
treec489f8c8d33de95b5a0de5741e578b5d8fde0e5a /drivers/gpu/drm/udl/udl_transfer.c
parenta2e4919a7ecb1e9bd29e526c2788ac2d04a993c0 (diff)
downloadlinux-fsl-qoriq-3916e1d71b62b120888aa50bcc8d9a6200fc19a7.tar.xz
drm/udl: fix stride issues scanning out stride != width*bpp
When buffer sharing with the i915 and using a 1680x1050 monitor, the i915 gives is a 6912 buffer for the 6720 width, the code doesn't render this properly as it uses one value to set the base address for reading from the vmap and for where to start on the device. This fixes it by calculating the values correctly for the device and for the pixmap. No idea how I haven't seen this before now. Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/udl/udl_transfer.c')
-rw-r--r--drivers/gpu/drm/udl/udl_transfer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/udl/udl_transfer.c b/drivers/gpu/drm/udl/udl_transfer.c
index dc09552..142fee5 100644
--- a/drivers/gpu/drm/udl/udl_transfer.c
+++ b/drivers/gpu/drm/udl/udl_transfer.c
@@ -213,11 +213,12 @@ static void udl_compress_hline16(
*/
int udl_render_hline(struct drm_device *dev, int bpp, struct urb **urb_ptr,
const char *front, char **urb_buf_ptr,
- u32 byte_offset, u32 byte_width,
+ u32 byte_offset, u32 device_byte_offset,
+ u32 byte_width,
int *ident_ptr, int *sent_ptr)
{
const u8 *line_start, *line_end, *next_pixel;
- u32 base16 = 0 + (byte_offset / bpp) * 2;
+ u32 base16 = 0 + (device_byte_offset / bpp) * 2;
struct urb *urb = *urb_ptr;
u8 *cmd = *urb_buf_ptr;
u8 *cmd_end = (u8 *) urb->transfer_buffer + urb->transfer_buffer_length;