Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219767
b: refs/heads/master
c: 9825f70
h: refs/heads/master
i:
  219765: 0be18e0
  219763: 7d7d477
  219759: 614fbd6
v: v3
  • Loading branch information
Bernie Thompson authored and Greg Kroah-Hartman committed Sep 5, 2010
1 parent 1581e66 commit e308c8c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 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: d46ecb9f79db82ce6bef4baafbcae29ac809ea67
refs/heads/master: 9825f70f5cf465a8c31236409456d18de07fd166
36 changes: 20 additions & 16 deletions trunk/drivers/staging/udlfb/udlfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ static char *dlfb_vidreg_unlock(char *buf)

/*
* On/Off for driving the DisplayLink framebuffer to the display
* 0x00 H and V sync on
* 0x01 H and V sync off (screen blank but powered)
* 0x07 DPMS powerdown (requires modeset to come back)
*/
static char *dlfb_enable_hvsync(char *buf, bool enable)
{
if (enable)
return dlfb_set_register(buf, 0x1F, 0x00);
else
return dlfb_set_register(buf, 0x1F, 0x01);
return dlfb_set_register(buf, 0x1F, 0x07);
}

static char *dlfb_set_color_depth(char *buf, u8 selection)
Expand Down Expand Up @@ -936,30 +939,31 @@ static int dlfb_ops_set_par(struct fb_info *info)
return dlfb_set_video_mode(dev, &info->var);
}

/*
* In order to come back from full DPMS off, we need to set the mode again
*/
static int dlfb_ops_blank(int blank_mode, struct fb_info *info)
{
struct dlfb_data *dev = info->par;
char *bufptr;
struct urb *urb;

urb = dlfb_get_urb(dev);
if (!urb)
return 0;
bufptr = (char *) urb->transfer_buffer;
if (blank_mode != FB_BLANK_UNBLANK) {
char *bufptr;
struct urb *urb;

/* overloading usb_active. UNBLANK can conflict with teardown */
urb = dlfb_get_urb(dev);
if (!urb)
return 0;

bufptr = dlfb_vidreg_lock(bufptr);
if (blank_mode != FB_BLANK_UNBLANK) {
atomic_set(&dev->usb_active, 0);
bufptr = (char *) urb->transfer_buffer;
bufptr = dlfb_vidreg_lock(bufptr);
bufptr = dlfb_enable_hvsync(bufptr, false);
bufptr = dlfb_vidreg_unlock(bufptr);

dlfb_submit_urb(dev, urb, bufptr -
(char *) urb->transfer_buffer);
} else {
atomic_set(&dev->usb_active, 1);
bufptr = dlfb_enable_hvsync(bufptr, true);
dlfb_set_video_mode(dev, &info->var);
}
bufptr = dlfb_vidreg_unlock(bufptr);

dlfb_submit_urb(dev, urb, bufptr - (char *) urb->transfer_buffer);

return 0;
}
Expand Down

0 comments on commit e308c8c

Please sign in to comment.