[PATCH 10/14] drm/mgag200: Don't use crtc_* parameters for validation
Daniel Vetter
daniel at ffwll.ch
Wed Jul 19 06:38:00 UTC 2017
On Tue, Jul 18, 2017 at 04:43:16PM +0200, Takashi Iwai wrote:
> From: Egbert Eich <eich at 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 at suse.de>
> Signed-off-by: Takashi Iwai <tiwai at 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
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dri-devel
mailing list