diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/drm_fb_helper.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_fb_helper.h | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_drv.c | 28 |
3 files changed, 33 insertions, 10 deletions
diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c index 31af94e7fa3..49f84462bf6 100644 --- a/sys/dev/pci/drm/drm_fb_helper.c +++ b/sys/dev/pci/drm/drm_fb_helper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_fb_helper.c,v 1.2 2013/03/19 03:58:10 jsg Exp $ */ +/* $OpenBSD: drm_fb_helper.c,v 1.3 2013/05/16 21:14:11 kettenis Exp $ */ /* * Copyright (c) 2006-2009 Red Hat Inc. * Copyright (c) 2006-2008 Intel Corporation @@ -372,11 +372,9 @@ static struct sysrq_key_op sysrq_drm_fb_helper_restore_op = { }; #endif #endif -#if 0 void -drm_fb_helper_dpms(struct fb_info *info, int dpms_mode) +drm_fb_helper_dpms(struct drm_fb_helper *fb_helper, int dpms_mode) { - struct drm_fb_helper *fb_helper = info->par; struct drm_device *dev = fb_helper->dev; struct drm_crtc *crtc; struct drm_connector *connector; @@ -385,7 +383,7 @@ drm_fb_helper_dpms(struct fb_info *info, int dpms_mode) /* * For each CRTC in this fb, turn the connectors on/off. */ - mutex_lock(&dev->mode_config.mutex); + rw_enter_write(&dev->mode_config.rwl); for (i = 0; i < fb_helper->crtc_count; i++) { crtc = fb_helper->crtc_info[i].mode_set.crtc; @@ -400,9 +398,8 @@ drm_fb_helper_dpms(struct fb_info *info, int dpms_mode) dev->mode_config.dpms_property, dpms_mode); } } - mutex_unlock(&dev->mode_config.mutex); + rw_exit_write(&dev->mode_config.rwl); } -#endif #if 0 int diff --git a/sys/dev/pci/drm/drm_fb_helper.h b/sys/dev/pci/drm/drm_fb_helper.h index 58b7a89968d..52db932b26c 100644 --- a/sys/dev/pci/drm/drm_fb_helper.h +++ b/sys/dev/pci/drm/drm_fb_helper.h @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_fb_helper.h,v 1.1 2013/03/18 12:36:51 jsg Exp $ */ +/* $OpenBSD: drm_fb_helper.h,v 1.2 2013/05/16 21:14:11 kettenis Exp $ */ /* * Copyright (c) 2006-2009 Red Hat Inc. * Copyright (c) 2006-2008 Intel Corporation @@ -119,4 +119,6 @@ int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper); int drm_fb_helper_debug_enter(struct fb_info *info); int drm_fb_helper_debug_leave(struct fb_info *info); +void drm_fb_helper_dpms(struct drm_fb_helper *fb_helper, int dpms_mode); + #endif diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index 8997675b44d..a8e8bc98ce8 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_drv.c,v 1.28 2013/05/15 10:24:36 jsg Exp $ */ +/* $OpenBSD: i915_drv.c,v 1.29 2013/05/16 21:14:11 kettenis Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -631,6 +631,7 @@ void inteldrm_free_screen(void *, void *); int inteldrm_show_screen(void *, void *, int, void (*)(void *, int, int), void *); void inteldrm_doswitch(void *, void *); +void inteldrm_burner(void *, u_int, u_int); struct wsscreen_descr inteldrm_stdscreen = { "std", @@ -654,7 +655,11 @@ struct wsdisplay_accessops inteldrm_accessops = { inteldrm_wsmmap, inteldrm_alloc_screen, inteldrm_free_screen, - inteldrm_show_screen + inteldrm_show_screen, + NULL, + NULL, + NULL, + inteldrm_burner }; extern int (*ws_get_param)(struct wsdisplay_param *); @@ -758,6 +763,25 @@ inteldrm_doswitch(void *v, void *cookie) (*dev_priv->switchcb)(dev_priv->switchcbarg, 0, 0); } +void +inteldrm_burner(void *v, u_int on, u_int flags) +{ + struct inteldrm_softc *dev_priv = v; + struct drm_fb_helper *helper = &dev_priv->fbdev->helper; + int dpms_mode; + + if (on) + dpms_mode = DRM_MODE_DPMS_ON; + else { + if (flags & WSDISPLAY_BURN_VBLANK) + dpms_mode = DRM_MODE_DPMS_OFF; + else + dpms_mode = DRM_MODE_DPMS_STANDBY; + } + + drm_fb_helper_dpms(helper, dpms_mode); +} + /* * Accelerated routines. */ |