linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.sourceforge.net,
	linux-fbdev-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/3] drm/fb: fix FBIOGET/PUT_VSCREENINFO pixel clock handling
Date: Tue, 03 Nov 2009 13:18:50 +0100	[thread overview]
Message-ID: <4AF01FAA.2040909@ladisch.de> (raw)
In-Reply-To: <4AF01F72.2030605@ladisch.de>

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>
---
No changes from v1.

 drivers/gpu/drm/drm_fb_helper.c |   6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6/drivers/gpu/drm/drm_fb_helper.c
+++ linux-2.6/drivers/gpu/drm/drm_fb_helper.c
@@ -599,7 +599,7 @@ int drm_fb_helper_check_var(struct fb_va
 	struct drm_framebuffer *fb = fb_helper->fb;
 	int depth;
 
-	if (var->pixclock == -1 || !var->pixclock)
+	if (var->pixclock != 0)
 		return -EINVAL;
 
 	/* Need to resize the fb object !!! */
@@ -691,7 +691,7 @@ int drm_fb_helper_set_par(struct fb_info
 	int ret;
 	int i;
 
-	if (var->pixclock != -1) {
+	if (var->pixclock != 0) {
 		DRM_ERROR("PIXEL CLCOK SET\n");
 		return -EINVAL;
 	}
@@ -904,7 +904,7 @@ int drm_fb_helper_single_fb_probe(struct
 	fb_helper->fb = fb;
 
 	if (new_fb) {
-		info->var.pixclock = -1;
+		info->var.pixclock = 0;
 		if (register_framebuffer(info) < 0)
 			return -EINVAL;
 	} else {

  reply	other threads:[~2009-11-03 12:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02  7:40 [PATCH 0/3] DRM/KMS framebuffer fixes Clemens Ladisch
2009-11-02  7:41 ` [PATCH 1/3] drm/fb: fix FBIOGET/PUT_VSCREENINFO pixel clock handling Clemens Ladisch
2009-11-02  7:42 ` [PATCH 2/3] drm/radeon/kms: allocate framebuffer cmap Clemens Ladisch
2009-11-02  7:42 ` [PATCH 3/3] drm/i915: " Clemens Ladisch
2009-11-02 14:33   ` James Simmons
2009-11-03 12:17     ` [PATCH v2 0/3] DRM/KMS framebuffer fixes Clemens Ladisch
2009-11-03 12:18       ` Clemens Ladisch [this message]
2009-11-03 12:19       ` [PATCH v2 2/3] drm: set the type of the drm_framebuffer::fbdev field Clemens Ladisch
2009-11-03 12:20       ` [PATCH v2 3/3] drm/kms: allocate framebuffer cmap Clemens Ladisch
2009-11-03 17:19         ` James Simmons
2009-11-04  8:40           ` [PATCH v3 0/3] DRM/KMS framebuffer fixes Clemens Ladisch
2009-11-04  8:42             ` [PATCH v3 1/3] drm/fb: fix FBIOGET/PUT_VSCREENINFO pixel clock handling Clemens Ladisch
2009-11-04  8:43             ` [PATCH v3 3/3] drm/kms: allocate framebuffer cmap Clemens Ladisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF01FAA.2040909@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).