From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id D4B3B899C7 for ; Wed, 13 Oct 2021 04:47:19 +0000 (UTC) Date: Tue, 12 Oct 2021 21:47:18 -0700 Message-ID: <87k0ihpm3t.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20211008065432.15482-2-zbigniew.kempczynski@intel.com> References: <20211008065432.15482-1-zbigniew.kempczynski@intel.com> <20211008065432.15482-2-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [PATCH i-g-t 1/7] lib/gem_submission: Add kernel exec object alignment capability List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Zbigniew =?ISO-8859-2?Q?Kempczy=F1ski?= Cc: igt-dev@lists.freedesktop.org, Petri Latvala List-ID: On Thu, 07 Oct 2021 23:54:26 -0700, Zbigniew Kempczy=F1ski wrote: > > +bool gem_allows_passing_alignment(int fd) > +{ > + struct drm_i915_gem_exec_object2 obj =3D { > + .handle =3D gem_create(fd, 4096), > + }; > + struct drm_i915_gem_execbuffer2 execbuf =3D { > + .buffers_ptr =3D to_user_pointer(&obj), > + .buffer_count =3D 1, > + }; > + bool ret; > + const uint32_t bbe =3D MI_BATCH_BUFFER_END; > + > + gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe)); > + gem_execbuf(fd, &execbuf); > + > + obj.alignment =3D 0x2000; 8K? Shouldn't this be less than 4K? > + ret =3D __gem_execbuf(fd, &execbuf) =3D=3D 0; > + gem_close(fd, obj.handle); > + > + return ret; > +}