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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 18, 2017 at 04:43:16PM +0200, Takashi Iwai wrote:
> From: Egbert Eich <eich@xxxxxxx>
> 
> 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@xxxxxxx>
> Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
> ---
>  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
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux