diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2009-11-04 03:42:52 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-11-18 22:02:46 -0500 |
commit | cda6be1ce27d721a88cb90543a1e6d0f41baeaa4 (patch) | |
tree | 3a30d44004a75a526719fbe7082a59327e44449a | |
parent | 731b5a15a3b1474a41c2ca29b4c32b0f21bc852e (diff) |
drm/fb: fix FBIOGET/PUT_VSCREENINFO pixel clock handling
When the framebuffer driver does not publish detailed timing information
for the current video mode, the correct value for the pixclock field is
zero, not -1.
Since pixclock is actually unsigned, the value -1 would be interpreted
as 4294967295 picoseconds (i.e., about 4 milliseconds) by
register_framebuffer() and userspace programs.
This patch allows X.org's fbdev driver to work.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index ea336d2f6529..e812babe2122 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
@@ -602,7 +602,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, | |||
602 | struct drm_framebuffer *fb = fb_helper->fb; | 602 | struct drm_framebuffer *fb = fb_helper->fb; |
603 | int depth; | 603 | int depth; |
604 | 604 | ||
605 | if (var->pixclock == -1 || !var->pixclock) | 605 | if (var->pixclock != 0) |
606 | return -EINVAL; | 606 | return -EINVAL; |
607 | 607 | ||
608 | /* Need to resize the fb object !!! */ | 608 | /* Need to resize the fb object !!! */ |
@@ -694,7 +694,7 @@ int drm_fb_helper_set_par(struct fb_info *info) | |||
694 | int ret; | 694 | int ret; |
695 | int i; | 695 | int i; |
696 | 696 | ||
697 | if (var->pixclock != -1) { | 697 | if (var->pixclock != 0) { |
698 | DRM_ERROR("PIXEL CLCOK SET\n"); | 698 | DRM_ERROR("PIXEL CLCOK SET\n"); |
699 | return -EINVAL; | 699 | return -EINVAL; |
700 | } | 700 | } |
@@ -907,7 +907,7 @@ int drm_fb_helper_single_fb_probe(struct drm_device *dev, | |||
907 | fb_helper->fb = fb; | 907 | fb_helper->fb = fb; |
908 | 908 | ||
909 | if (new_fb) { | 909 | if (new_fb) { |
910 | info->var.pixclock = -1; | 910 | info->var.pixclock = 0; |
911 | if (register_framebuffer(info) < 0) | 911 | if (register_framebuffer(info) < 0) |
912 | return -EINVAL; | 912 | return -EINVAL; |
913 | } else { | 913 | } else { |