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. Cc: <stable@xxxxxxxxxx> Signed-off-by: Jerome Glisse <jglisse@xxxxxxxxxx> --- 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@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel