From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH] drm/i915: Error out when trying to set a y-tiled as a sprite Date: Mon, 29 Oct 2012 18:24:09 +0200 Message-ID: <20121029162409.GC3791@intel.com> References: <1351272650-8402-1-git-send-email-damien.lespiau@gmail.com> <20121026104254.6d4896ef@jbarnes-desktop> <6c3329$6ur22h@orsmga002.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D3359F706 for ; Mon, 29 Oct 2012 09:25:23 -0700 (PDT) Content-Disposition: inline In-Reply-To: <6c3329$6ur22h@orsmga002.jf.intel.com> 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: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sun, Oct 28, 2012 at 10:04:54AM +0000, Chris Wilson wrote: > On Fri, 26 Oct 2012 10:42:54 -0700, Jesse Barnes wrote: > > On Fri, 26 Oct 2012 18:30:50 +0100 > > Damien Lespiau wrote: > > = > > > From: Damien Lespiau > > > = > > > Signed-off-by: Damien Lespiau > > > --- > > > drivers/gpu/drm/i915/intel_sprite.c | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > = > > > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i9= 15/intel_sprite.c > > > index 3434b6e..aa8d09b 100644 > > > --- a/drivers/gpu/drm/i915/intel_sprite.c > > > +++ b/drivers/gpu/drm/i915/intel_sprite.c > > > @@ -465,6 +465,11 @@ intel_update_plane(struct drm_plane *plane, stru= ct drm_crtc *crtc, > > > if (intel_plane->pipe !=3D intel_crtc->pipe) > > > return -EINVAL; > > > = > > > + /* Sprite planes can be linear or x-tiled surfaces */ > > > + if (!(obj->tiling_mode =3D=3D I915_TILING_NONE || > > > + obj->tiling_mode =3D=3D I915_TILING_X)) > > > + return -EINVAL; > > > + > > > /* > > > * Clamp the width & height into the visible area. Note we don't > > > * try to scale the source if part of the visible region is offscre= en. > > = > > Do we not catch this when we make the fb? If not we may want to do > > this there... > = > We do. However, we don't catch userspace changing the tiling on an > existing fb (unless actually pinned)... Why not simply count how many fbs reference a given bo, and reject tiling changes when the count > 0? -- = Ville Syrj=E4l=E4 Intel OTC