From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH] drm/i915: Detect invalid scanout pitches Date: Thu, 20 Jun 2013 15:44:56 +0300 Message-ID: <20130620124456.GK5004@intel.com> References: <1371655244-8368-1-git-send-email-chris@chris-wilson.co.uk> <1371657034-9189-1-git-send-email-chris@chris-wilson.co.uk> <20130620081716.GH5004@intel.com> <20130620091436.GC18932@cantiga.alporthouse.com> <20130620102909.GI5004@intel.com> <20130620122714.GA8936@cantiga.alporthouse.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 6F2F6E5D59 for ; Thu, 20 Jun 2013 05:44:59 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130620122714.GA8936@cantiga.alporthouse.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 , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Jun 20, 2013 at 01:27:14PM +0100, Chris Wilson wrote: > On Thu, Jun 20, 2013 at 01:29:10PM +0300, Ville Syrj=E4l=E4 wrote: > > On Thu, Jun 20, 2013 at 10:14:36AM +0100, Chris Wilson wrote: > > > On Thu, Jun 20, 2013 at 11:17:16AM +0300, Ville Syrj=E4l=E4 wrote: > > > > We already have a bit of pitch checking in intel_framebuffer_init(). > > > > In fact there's a FIXME about pre-ilk limits there. > > > = > > > It looks tidier to fix that check. We still need to double check the > > > values though as the tiling mode is independent of the fb config and = may > > > be changed by the user. > > = > > True, some checking needs to be done after pinning. > > = > > I guess we could have one function that has the checks, and just call it > > from both places. > = > I'm thinking we note the tiling (and anything else of significance) > during framebuffer_init() and reject the set-base if the object changes. > I don't think any userspace depends upon being able to change the object > after AddFB, and I don't think we want to allow the fb/obj to so easily > become inconsistent. An alternative idea I've been tossing around is that we'd reject tiling changes while we have drm_framebuffers pointing at the object. So some kind of fb_refcount on the object. That would make buggy user space trip over a bit earlier. But either way seems reasonable to me. -- = Ville Syrj=E4l=E4 Intel OTC