From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id B26CA6E5D2 for ; Wed, 12 Feb 2020 04:29:12 +0000 (UTC) Date: Tue, 11 Feb 2020 20:17:42 -0800 Message-ID: <87pnekv3q1.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20200211191845.GA929@ideak-desk.fi.intel.com> References: <20200207191524.19362-1-imre.deak@intel.com> <87y2tcwvt5.wl-ashutosh.dixit@intel.com> <20200210113754.GA31846@ideak-desk.fi.intel.com> <877e0tvt2i.wl-ashutosh.dixit@intel.com> <20200211191845.GA929@ideak-desk.fi.intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Subject: Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: imre.deak@intel.com Cc: igt-dev@lists.freedesktop.org List-ID: On Tue, 11 Feb 2020 11:18:45 -0800, Imre Deak wrote: > On Tue, Feb 11, 2020 at 11:10:13AM -0800, Dixit, Ashutosh wrote: > > On Mon, 10 Feb 2020 03:37:54 -0800, Imre Deak wrote: > > > > > > On Sat, Feb 08, 2020 at 02:36:38PM -0800, Dixit, Ashutosh wrote: > > > > On Fri, 07 Feb 2020 11:15:17 -0800, Imre Deak wrote: > > > > > void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context, > > > > > uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride, > > > > > - enum igt_draw_method method, int rect_x, int rect_y, > > > > > - int rect_w, int rect_h, uint32_t color, int bpp) > > > > > + uint32_t tiling, enum igt_draw_method method, > > > > > + int rect_x, int rect_y, int rect_w, int rect_h, > > > > > + uint32_t color, int bpp) > > > > > { > > > > > + uint32_t buf_tiling, swizzle; > > > > > + > > > > > struct cmd_data cmd_data = { > > > > > .bufmgr = bufmgr, > > > > > .context = context, > > > > > @@ -667,24 +660,32 @@ void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context, > > > > > .h = rect_h, > > > > > }; > > > > > > > > > > + swizzle = I915_BIT_6_SWIZZLE_NONE; > > > > > + if (tiling != I915_TILING_NONE && gem_available_fences(fd)) { > > > > > + gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle); > > > > > + igt_assert(tiling == buf_tiling); > > > > > + } > > > > > > > > Probably a nit, but looks a little strange to call gem_get_tiling() to get > > > > the swizzle and then doing an assert. > > > > > > gem_get_tiling() is the way to get the swizzling for a buffer. The > > > assert only makes sure that the caller's and kernel's idea of the tiling > > > matches. While the callers will pick the tiling (when creating the > > > buffer), the swizzling is fixed based on this tiling and platform. > > > > Let me ask a different way, do we even need the new tiling argument to > > igt_draw_rect()? Can't we just do: > > > > if (gem_available_fences(fd)) > > gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle); > > > > Basically if we have the handle we should just be able to query the tiling. > > We do need to handle different tilings even if > !gem_available_fences(fd), so we need the tiling param. Note that HW > detiling support via GGTT != tiling support by display,gt engines. OK: Reviewed-by: Ashutosh Dixit _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev