diff options
author | Dave Airlie <airlied@redhat.com> | 2010-03-30 07:34:17 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-04-07 02:29:52 +0200 |
commit | 5c4426a782bc9509573fc7958a786ebd14fafdf3 (patch) | |
tree | ce701b338b6cd84e07a6259b56dca9df9875aedb /drivers/gpu/drm/radeon/radeon_fb.c | |
parent | drm/kms/fb: provide a 1024x768 fbcon if no outputs found. (diff) | |
download | linux-5c4426a782bc9509573fc7958a786ebd14fafdf3.tar.xz linux-5c4426a782bc9509573fc7958a786ebd14fafdf3.zip |
drm/kms/fb: add polling support for when nothing is connected.
When we are running in a headless environment we have no idea what
output the user might plug in later, we only have hotplug detect
from the digital outputs. So if we detect no connected outputs at
initialisation, start a slow work operation to poll every 5 seconds
for an output.
this is only hooked up for radeon so far, on hw where we have full
hotplug detection there is no need for this.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_fb.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fb.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 7275b2e09444..7913e50fe501 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c @@ -321,18 +321,23 @@ static int radeonfb_probe(struct radeon_fbdev *rfbdev) return drm_fb_helper_single_fb_probe(&rfbdev->helper, bpp_sel); } -void radeonfb_hotplug(struct drm_device *dev) +void radeonfb_hotplug(struct drm_device *dev, bool polled) { struct radeon_device *rdev = dev->dev_private; int max_width, max_height; max_width = rdev->mode_info.rfbdev->rfb.base.width; max_height = rdev->mode_info.rfbdev->rfb.base.height; - drm_helper_fb_hotplug_event(&rdev->mode_info.rfbdev->helper, max_width, max_height); + drm_helper_fb_hotplug_event(&rdev->mode_info.rfbdev->helper, max_width, max_height, polled); radeonfb_probe(rdev->mode_info.rfbdev); } +static void radeon_fb_poll_changed(struct drm_fb_helper *fb_helper) +{ + radeonfb_hotplug(fb_helper->dev, true); +} + static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfbdev) { struct fb_info *info; @@ -381,8 +386,12 @@ int radeon_fbdev_init(struct radeon_device *rdev) drm_fb_helper_single_add_all_connectors(&rfbdev->helper); + rfbdev->helper.fb_poll_changed = radeon_fb_poll_changed; + drm_fb_helper_poll_init(&rfbdev->helper); + drm_fb_helper_initial_config(&rfbdev->helper); radeonfb_probe(rfbdev); + return 0; } @@ -392,6 +401,7 @@ void radeon_fbdev_fini(struct radeon_device *rdev) if (!rdev->mode_info.rfbdev) return; + drm_fb_helper_poll_fini(&rdev->mode_info.rfbdev->helper); radeon_fbdev_destroy(rdev->ddev, rdev->mode_info.rfbdev); kfree(rdev->mode_info.rfbdev); rdev->mode_info.rfbdev = NULL; |