Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271221
b: refs/heads/master
c: def7660
h: refs/heads/master
i:
  271219: da45302
v: v3
  • Loading branch information
Dr. David Alan Gilbert authored and Florian Tobias Schandinat committed Aug 24, 2011
1 parent 6c820c4 commit 1091ddc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f2e1fc9d5d12fbc06590ac4987dce6f79d86f1c7
refs/heads/master: def76608681983c1fe70c0fa780d8fe777442ef5
30 changes: 16 additions & 14 deletions trunk/drivers/video/udlfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,21 +776,25 @@ static int dlfb_ops_ioctl(struct fb_info *info, unsigned int cmd,
{

struct dlfb_data *dev = info->par;
struct dloarea *area = NULL;

if (!atomic_read(&dev->usb_active))
return 0;

/* TODO: Update X server to get this from sysfs instead */
if (cmd == DLFB_IOCTL_RETURN_EDID) {
char *edid = (char *)arg;
void __user *edid = (void __user *)arg;
if (copy_to_user(edid, dev->edid, dev->edid_size))
return -EFAULT;
return 0;
}

/* TODO: Help propose a standard fb.h ioctl to report mmap damage */
if (cmd == DLFB_IOCTL_REPORT_DAMAGE) {
struct dloarea area;

if (copy_from_user(&area, (void __user *)arg,
sizeof(struct dloarea)))
return -EFAULT;

/*
* If we have a damage-aware client, turn fb_defio "off"
Expand All @@ -802,21 +806,19 @@ static int dlfb_ops_ioctl(struct fb_info *info, unsigned int cmd,
if (info->fbdefio)
info->fbdefio->delay = DL_DEFIO_WRITE_DISABLE;

area = (struct dloarea *)arg;

if (area->x < 0)
area->x = 0;
if (area.x < 0)
area.x = 0;

if (area->x > info->var.xres)
area->x = info->var.xres;
if (area.x > info->var.xres)
area.x = info->var.xres;

if (area->y < 0)
area->y = 0;
if (area.y < 0)
area.y = 0;

if (area->y > info->var.yres)
area->y = info->var.yres;
if (area.y > info->var.yres)
area.y = info->var.yres;

dlfb_handle_damage(dev, area->x, area->y, area->w, area->h,
dlfb_handle_damage(dev, area.x, area.y, area.w, area.h,
info->screen_base);
}

Expand Down Expand Up @@ -864,7 +866,7 @@ static int dlfb_ops_open(struct fb_info *info, int user)
* preventing other clients (X) from working properly. Usually
* not what the user wants. Fail by default with option to enable.
*/
if ((user == 0) & (!console))
if ((user == 0) && (!console))
return -EBUSY;

/* If the USB device is gone, we don't accept new opens */
Expand Down

0 comments on commit 1091ddc

Please sign in to comment.