[PATCH] drm/radeon/kms: fix legacy LVDS mode computation

Alex Deucher alexdeucher at gmail.com
Fri Apr 30 08:16:57 PDT 2010


On Fri, Apr 30, 2010 at 6:08 AM, Jerome Glisse <jglisse at redhat.com> wrote:
> From: John Doe <glisse at ned.localdomain>
>
> Compute downscaled mode timing like DDX does on legacy hw.
> With this patch it's now possible to use non native laptop
> panel resolution. Tested on M7 (7500) laptop.

I think I just had the logic reversed previously.  Does the attached
patch also fix the issue?  It should fix the avivo scaling problems
that were reported as well.

Alex


>
> Cc: <stable at kernel.org>
> Signed-off-by: Jerome Glisse <jglisse at redhat.com>
> ---
>  drivers/gpu/drm/radeon/radeon_legacy_encoders.c |   23 ++++++++++++++++++++++-
>  1 files changed, 22 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
> index 2441cca..0d78f5b 100644
> --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
> +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
> @@ -219,6 +219,8 @@ static bool radeon_legacy_mode_fixup(struct drm_encoder *encoder,
>        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
>        struct drm_device *dev = encoder->dev;
>        struct radeon_device *rdev = dev->dev_private;
> +       unsigned hsync_width, vsync_width;
> +       unsigned hover, vover, hblank, vblank;
>
>        /* adjust pm to upcoming mode change */
>        radeon_pm_compute_clocks(rdev);
> @@ -237,8 +239,27 @@ static bool radeon_legacy_mode_fixup(struct drm_encoder *encoder,
>                adjusted_mode->crtc_hdisplay = mode->hdisplay;
>                adjusted_mode->crtc_vdisplay = mode->vdisplay;
>                adjusted_mode->base.id = mode_id;
> +               hblank = native_mode->htotal - native_mode->hdisplay;
> +               vblank = native_mode->vtotal - native_mode->vdisplay;
> +               hover = native_mode->hsync_start - native_mode->hdisplay;
> +               vover = native_mode->vsync_start - native_mode->vdisplay;
> +               hsync_width = native_mode->hsync_end - native_mode->hsync_start;
> +               vsync_width = native_mode->vsync_end - native_mode->vsync_start;
> +               adjusted_mode->crtc_hsync_start = mode->hdisplay + hover;
> +               adjusted_mode->crtc_hsync_end = adjusted_mode->crtc_hsync_start + hsync_width;
> +               adjusted_mode->crtc_htotal = mode->hdisplay + hblank;
> +               adjusted_mode->crtc_vsync_start = mode->vdisplay + vover;
> +               adjusted_mode->crtc_vsync_end = adjusted_mode->crtc_vsync_start + vsync_width;
> +               adjusted_mode->crtc_vtotal = mode->vdisplay + vblank;
> +               adjusted_mode->crtc_hblank_start = mode->hdisplay;
> +               adjusted_mode->crtc_vblank_start = mode->vdisplay;
> +               adjusted_mode->hsync_start = adjusted_mode->crtc_hsync_start;
> +               adjusted_mode->hsync_end = adjusted_mode->crtc_hsync_end;
> +               adjusted_mode->htotal = adjusted_mode->crtc_htotal;
> +               adjusted_mode->vsync_start = adjusted_mode->crtc_vsync_start;
> +               adjusted_mode->vsync_end = adjusted_mode->crtc_vsync_end;
> +               adjusted_mode->vtotal = adjusted_mode->crtc_vtotal;
>        }
> -
>        return true;
>  }
>
> --
> 1.7.0.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-drm-radeon-kms-fix-reversed-logic-in-panel-scaling.patch
Type: application/mbox
Size: 2029 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20100430/1305e4e2/attachment.bin>


More information about the dri-devel mailing list