.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2012 Red Hat |
---|
3 | 4 | * based in parts on udlfb.c: |
---|
4 | 5 | * Copyright (C) 2009 Roberto De Ioris <roberto@unbit.it> |
---|
5 | 6 | * Copyright (C) 2009 Jaya Kumar <jayakumar.lkml@gmail.com> |
---|
6 | 7 | * Copyright (C) 2009 Bernie Thompson <bernie@plugable.com> |
---|
7 | | - * |
---|
8 | | - * This file is subject to the terms and conditions of the GNU General Public |
---|
9 | | - * License v2. See the file COPYING in the main directory of this archive for |
---|
10 | | - * more details. |
---|
11 | 8 | */ |
---|
12 | 9 | |
---|
13 | | -#include <linux/module.h> |
---|
14 | | -#include <linux/slab.h> |
---|
15 | | -#include <linux/fb.h> |
---|
16 | 10 | #include <asm/unaligned.h> |
---|
17 | 11 | |
---|
18 | | -#include <drm/drmP.h> |
---|
19 | 12 | #include "udl_drv.h" |
---|
20 | 13 | |
---|
21 | 14 | #define MAX_CMD_PIXELS 255 |
---|
.. | .. |
---|
219 | 212 | int udl_render_hline(struct drm_device *dev, int log_bpp, struct urb **urb_ptr, |
---|
220 | 213 | const char *front, char **urb_buf_ptr, |
---|
221 | 214 | u32 byte_offset, u32 device_byte_offset, |
---|
222 | | - u32 byte_width, |
---|
223 | | - int *ident_ptr, int *sent_ptr) |
---|
| 215 | + u32 byte_width) |
---|
224 | 216 | { |
---|
225 | 217 | const u8 *line_start, *line_end, *next_pixel; |
---|
226 | 218 | u32 base16 = 0 + (device_byte_offset >> log_bpp) * 2; |
---|
.. | .. |
---|
242 | 234 | |
---|
243 | 235 | if (cmd >= cmd_end) { |
---|
244 | 236 | int len = cmd - (u8 *) urb->transfer_buffer; |
---|
245 | | - if (udl_submit_urb(dev, urb, len)) |
---|
246 | | - return 1; /* lost pixels is set */ |
---|
247 | | - *sent_ptr += len; |
---|
| 237 | + int ret = udl_submit_urb(dev, urb, len); |
---|
| 238 | + if (ret) |
---|
| 239 | + return ret; |
---|
248 | 240 | urb = udl_get_urb(dev); |
---|
249 | 241 | if (!urb) |
---|
250 | | - return 1; /* lost_pixels is set */ |
---|
| 242 | + return -EAGAIN; |
---|
251 | 243 | *urb_ptr = urb; |
---|
252 | 244 | cmd = urb->transfer_buffer; |
---|
253 | 245 | cmd_end = &cmd[urb->transfer_buffer_length]; |
---|
.. | .. |
---|
258 | 250 | |
---|
259 | 251 | return 0; |
---|
260 | 252 | } |
---|
261 | | - |
---|