2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 20:23:57 +08:00

drm/udl: Remove field lost_pixels from struct udl_device

The field lost_pixels in struct udl_device was supposed to signal an
error during USB transfers of the framebuffer data. The driver would
have to schedule a re-transfer at a later point. This code was never
implemented. Remove lost_pixels and return regular error codes instead.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191206085954.9697-8-tzimmermann@suse.de
This commit is contained in:
Thomas Zimmermann 2019-12-06 09:59:54 +01:00
parent 798ce3fe1c
commit 1ca3fd96f9
4 changed files with 8 additions and 10 deletions

View File

@ -62,7 +62,6 @@ struct udl_device {
int sku_pixel_limit; int sku_pixel_limit;
struct urb_list urbs; struct urb_list urbs;
atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */
char mode_buf[1024]; char mode_buf[1024];
uint32_t mode_buf_len; uint32_t mode_buf_len;

View File

@ -141,9 +141,10 @@ int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
const int byte_offset = line_offset + (clip.x1 << log_bpp); const int byte_offset = line_offset + (clip.x1 << log_bpp);
const int dev_byte_offset = (fb->width * i + clip.x1) << log_bpp; const int dev_byte_offset = (fb->width * i + clip.x1) << log_bpp;
const int byte_width = (clip.x2 - clip.x1) << log_bpp; const int byte_width = (clip.x2 - clip.x1) << log_bpp;
if (udl_render_hline(dev, log_bpp, &urb, (char *)vaddr, ret = udl_render_hline(dev, log_bpp, &urb, (char *)vaddr,
&cmd, byte_offset, dev_byte_offset, &cmd, byte_offset, dev_byte_offset,
byte_width)) byte_width);
if (ret)
goto out_drm_gem_shmem_vunmap; goto out_drm_gem_shmem_vunmap;
} }

View File

@ -140,7 +140,6 @@ void udl_urb_completion(struct urb *urb)
urb->status == -ESHUTDOWN)) { urb->status == -ESHUTDOWN)) {
DRM_ERROR("%s - nonzero write bulk status received: %d\n", DRM_ERROR("%s - nonzero write bulk status received: %d\n",
__func__, urb->status); __func__, urb->status);
atomic_set(&udl->lost_pixels, 1);
} }
} }
@ -271,7 +270,6 @@ struct urb *udl_get_urb(struct drm_device *dev)
/* Wait for an in-flight buffer to complete and get re-queued */ /* Wait for an in-flight buffer to complete and get re-queued */
ret = down_timeout(&udl->urbs.limit_sem, GET_URB_TIMEOUT); ret = down_timeout(&udl->urbs.limit_sem, GET_URB_TIMEOUT);
if (ret) { if (ret) {
atomic_set(&udl->lost_pixels, 1);
DRM_INFO("wait for urb interrupted: %x available: %d\n", DRM_INFO("wait for urb interrupted: %x available: %d\n",
ret, udl->urbs.available); ret, udl->urbs.available);
goto error; goto error;
@ -304,7 +302,6 @@ int udl_submit_urb(struct drm_device *dev, struct urb *urb, size_t len)
ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret) { if (ret) {
udl_urb_completion(urb); /* because no one else will */ udl_urb_completion(urb); /* because no one else will */
atomic_set(&udl->lost_pixels, 1);
DRM_ERROR("usb_submit_urb error %x\n", ret); DRM_ERROR("usb_submit_urb error %x\n", ret);
} }
return ret; return ret;

View File

@ -234,11 +234,12 @@ int udl_render_hline(struct drm_device *dev, int log_bpp, struct urb **urb_ptr,
if (cmd >= cmd_end) { if (cmd >= cmd_end) {
int len = cmd - (u8 *) urb->transfer_buffer; int len = cmd - (u8 *) urb->transfer_buffer;
if (udl_submit_urb(dev, urb, len)) int ret = udl_submit_urb(dev, urb, len);
return 1; /* lost pixels is set */ if (ret)
return ret;
urb = udl_get_urb(dev); urb = udl_get_urb(dev);
if (!urb) if (!urb)
return 1; /* lost_pixels is set */ return -EAGAIN;
*urb_ptr = urb; *urb_ptr = urb;
cmd = urb->transfer_buffer; cmd = urb->transfer_buffer;
cmd_end = &cmd[urb->transfer_buffer_length]; cmd_end = &cmd[urb->transfer_buffer_length];