diff mbox

[10/14] drm/mgag200: Don't use crtc_* parameters for validation

Message ID 20170718144320.8354-11-tiwai@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Iwai July 18, 2017, 2:43 p.m. UTC
From: Egbert Eich <eich@suse.de>

The crtc_* are wrong references as the mode parameters to validate,
use the ones without crtc_ prefix instead.

Signed-off-by: Egbert Eich <eich@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Daniel Vetter July 19, 2017, 6:38 a.m. UTC | #1
On Tue, Jul 18, 2017 at 04:43:16PM +0200, Takashi Iwai wrote:
> From: Egbert Eich <eich@suse.de>
> 
> The crtc_* are wrong references as the mode parameters to validate,
> use the ones without crtc_ prefix instead.

They only differ for interlaced/double. You might want to set the
set_crtcinfo flags differently. crtc_ are meant to be the values
programmed into hw, and this looks like hw limits here.

Just fyi, I didn't read the driver code, so probably wrong :-)
-Daniel

> 
> Signed-off-by: Egbert Eich <eich@suse.de>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  drivers/gpu/drm/mgag200/mgag200_mode.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
> index 7c8e3c6ace0b..a07f67ed6e4a 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_mode.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
> @@ -1758,12 +1758,12 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
>  		return MODE_H_ILLEGAL;
>  	}
>  
> -	if (mode->crtc_hdisplay > 2048 || mode->crtc_hsync_start > 4096 ||
> -	    mode->crtc_hsync_end > 4096 || mode->crtc_htotal > 4096 ||
> -	    mode->crtc_vdisplay > 2048 * lace ||
> -	    mode->crtc_vsync_start > 4096 * lace ||
> -	    mode->crtc_vsync_end > 4096 * lace ||
> -	    mode->crtc_vtotal > 4096 * lace) {
> +	if (mode->hdisplay > 2048 || mode->hsync_start > 4096 ||
> +	    mode->hsync_end > 4096 || mode->htotal > 4096 ||
> +	    mode->vdisplay > 2048 * lace ||
> +	    mode->vsync_start > 4096 * lace ||
> +	    mode->vsync_end > 4096 * lace ||
> +	    mode->vtotal > 4096 * lace) {
>  		return MODE_BAD;
>  	}
>  
> -- 
> 2.13.2
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 7c8e3c6ace0b..a07f67ed6e4a 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1758,12 +1758,12 @@  static int mga_vga_mode_valid(struct drm_connector *connector,
 		return MODE_H_ILLEGAL;
 	}
 
-	if (mode->crtc_hdisplay > 2048 || mode->crtc_hsync_start > 4096 ||
-	    mode->crtc_hsync_end > 4096 || mode->crtc_htotal > 4096 ||
-	    mode->crtc_vdisplay > 2048 * lace ||
-	    mode->crtc_vsync_start > 4096 * lace ||
-	    mode->crtc_vsync_end > 4096 * lace ||
-	    mode->crtc_vtotal > 4096 * lace) {
+	if (mode->hdisplay > 2048 || mode->hsync_start > 4096 ||
+	    mode->hsync_end > 4096 || mode->htotal > 4096 ||
+	    mode->vdisplay > 2048 * lace ||
+	    mode->vsync_start > 4096 * lace ||
+	    mode->vsync_end > 4096 * lace ||
+	    mode->vtotal > 4096 * lace) {
 		return MODE_BAD;
 	}