[PATCH 16/16] drm/mgag200: Add doublescan and interlace support
Egbert Eich
eich at suse.com
Wed Jul 17 06:07:29 PDT 2013
This code was ported from the xorg mga driver.
Signed-off-by: Egbert Eich <eich at suse.com>
---
drivers/gpu/drm/mgag200/mgag200_mode.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 0bb0e1e..3faacbe 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1488,6 +1488,7 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
struct mga_fbdev *mfbdev = mdev->mfbdev;
struct drm_fb_helper *fb_helper = &mfbdev->helper;
struct drm_fb_helper_connector *fb_helper_conn = NULL;
+ int lace = 1 + ((mode->flags & DRM_MODE_FLAG_INTERLACE) ? 1 : 0);
int bpp = 32;
int i = 0;
@@ -1537,8 +1538,10 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
if (mode->crtc_hdisplay > 2048 || mode->crtc_hsync_start > 4096 ||
mode->crtc_hsync_end > 4096 || mode->crtc_htotal > 4096 ||
- mode->crtc_vdisplay > 2048 || mode->crtc_vsync_start > 4096 ||
- mode->crtc_vsync_end > 4096 || mode->crtc_vtotal > 4096) {
+ mode->crtc_vdisplay > 2048 * lace ||
+ mode->crtc_vsync_start > 4096 * lace ||
+ mode->crtc_vsync_end > 4096 * lace ||
+ mode->crtc_vtotal > 4096 * lace) {
return MODE_BAD;
}
@@ -1622,6 +1625,9 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev)
connector = &mga_connector->base;
+ connector->interlace_allowed = true;
+ connector->doublescan_allowed = true;
+
drm_connector_init(dev, connector,
&mga_vga_connector_funcs, DRM_MODE_CONNECTOR_VGA);
--
1.8.1.4
More information about the dri-devel
mailing list