dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Takashi Iwai <tiwai@suse.de>
Cc: Egbert Eich <eich@suse.de>, Dave Airlie <airlied@redhat.com>,
	Mathieu Larouche <mathieu.larouche@matrox.com>,
	dri-devel@lists.freedesktop.org,
	Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH 10/14] drm/mgag200: Don't use crtc_* parameters for validation
Date: Wed, 19 Jul 2017 08:38:00 +0200	[thread overview]
Message-ID: <20170719063800.yt3vd4sv6lvnd63u@phenom.ffwll.local> (raw)
In-Reply-To: <20170718144320.8354-11-tiwai@suse.de>

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
> 

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

  reply	other threads:[~2017-07-19  6:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 14:43 [PATCH 00/14] mgag200 fixes Takashi Iwai
2017-07-18 14:43 ` [PATCH 01/14] drm/mgag200: Add doublescan and interlace support Takashi Iwai
2017-07-18 14:43 ` [PATCH 02/14] drm/mgag200: Add additional limits for certain G200 variants Takashi Iwai
2017-07-18 14:43 ` [PATCH 03/14] drm/mgag200: Fix memleak in error path in mgag200_bo_create() Takashi Iwai
2017-07-18 14:43 ` [PATCH 04/14] drm/mgag200: Free container instead of member in mga_user_framebuffer_destroy() Takashi Iwai
2017-07-18 14:43 ` [PATCH 05/14] drm/mgag200: Initialize data needed to map fbdev memory Takashi Iwai
2017-07-18 14:43 ` [PATCH 06/14] drm/mgag200: Simplify function mgag200_ttm_placement() Takashi Iwai
2017-07-18 14:43 ` [PATCH 07/14] drm/mgag200: Add support for MATROX PCI device IDs 0x520 and 0x521 Takashi Iwai
2017-07-20  4:17   ` Dave Airlie
2017-07-20  9:47     ` Takashi Iwai
2017-07-20 15:05       ` Egbert Eich
2017-07-18 14:43 ` [PATCH 08/14] drm/mgag200: Cleanup cursor BOs properly Takashi Iwai
2017-07-18 14:43 ` [PATCH 09/14] drm/mgag200: Add missing drm_connector_unregister() Takashi Iwai
2017-07-19  8:44   ` Takashi Iwai
2017-07-20  8:15     ` Daniel Vetter
2017-07-18 14:43 ` [PATCH 10/14] drm/mgag200: Don't use crtc_* parameters for validation Takashi Iwai
2017-07-19  6:38   ` Daniel Vetter [this message]
2017-07-18 14:43 ` [PATCH 11/14] drm/mgag200: Consolidate depth/bpp handling Takashi Iwai
2017-07-20 11:58   ` Paul Menzel
2017-07-20 12:08     ` Takashi Iwai
2017-07-18 14:43 ` [PATCH 12/14] drm/mgag200: Add command line option to specify preferred depth Takashi Iwai
2017-07-18 14:43 ` [PATCH 13/14] drm/mgag200: Add mode validation debugging code Takashi Iwai
2017-07-18 14:43 ` [PATCH 14/14] drm/mgag200: Implement basic PM support Takashi Iwai
2017-08-01 19:25 ` [PATCH 00/14] mgag200 fixes Mathieu Larouche
2017-08-01 21:18   ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170719063800.yt3vd4sv6lvnd63u@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eich@suse.de \
    --cc=mathieu.larouche@matrox.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).