From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 11/29] drm/i915: share pipe count handling with Ivybridge Date: Tue, 17 Apr 2012 12:38:06 +0100 Message-ID: <1334662700_12561@CP5-2952> References: <1334347745-11743-1-git-send-email-eugeni.dodonov@intel.com> <1334347745-11743-12-git-send-email-eugeni.dodonov@intel.com> <20120417101916.GF4104@phenom.ffwll.local> <1334659009_12270@CP5-2952> <20120417112619.GL4104@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (smtp.fireflyinternet.com [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id EE6459E9B4 for ; Tue, 17 Apr 2012 04:38:26 -0700 (PDT) In-Reply-To: <20120417112619.GL4104@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org, Eugeni Dodonov List-Id: intel-gfx@lists.freedesktop.org On Tue, 17 Apr 2012 13:26:19 +0200, Daniel Vetter wrote: > On Tue, Apr 17, 2012 at 11:36:33AM +0100, Chris Wilson wrote: > > On Tue, 17 Apr 2012 12:19:16 +0200, Daniel Vetter wrote: > > > On Fri, Apr 13, 2012 at 05:08:47PM -0300, Eugeni Dodonov wrote: > > > > Reviewed-by: Rodrigo Vivi > > > > Signed-off-by: Eugeni Dodonov > > > > --- > > > > drivers/gpu/drm/i915/intel_display.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > > > > index 3d78686..5ee652d 100644 > > > > --- a/drivers/gpu/drm/i915/intel_display.c > > > > +++ b/drivers/gpu/drm/i915/intel_display.c > > > > @@ -2427,7 +2427,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, > > > > case 1: > > > > break; > > > > case 2: > > > > - if (IS_IVYBRIDGE(dev)) > > > > + if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) > > > > break; > > > > /* fall through otherwise */ > > > > default: > > > > > > Imo this code is a rather funky way to check for 3 plane support ... I > > > think we should just replace this entire switch statement with a > > > if(WARN_ON(intel_crtc->plane > dev_priv->num_pipes)) return -EINVAL; > > > > > > Or has there been another reason for this? Chris, git blame says you've > > > originally added this in 5c3b82e2, any comments? > > > > Yup, it's just a userspace (and internal consistency) validation check, so > > if (pipe >= dev_priv->num_pipes) return -EINVAL; would have sufficed. > > Hm, how can userspace trigger this? It can only pass in crtc ids, which > the drm core validates. intel_crtc->plane is completely in our control, > hence why I think this can only be a driver bug. Or do I miss something? Shooting the messanger here. :-p Right, userspace cannot assign pipes, that is purely an internal detail. So this can be promoted to a if (WARN(pipe >= num_pipes)) return -EINVAL; or killed outright. All I did in that commit was perform the existing consistency check upfront, and return -EINVAL alongside the DRM_ERROR. -Chris -- Chris Wilson, Intel Open Source Technology Centre