[igt-dev] [PATCH 2/2] lib/igt_draw: Add MOCS values for MTL

Lucas De Marchi lucas.demarchi at intel.com
Wed Jan 18 20:36:56 UTC 2023


On Wed, Jan 18, 2023 at 02:15:51AM -0800, B, Jeevan wrote:
>
>
>> -----Original Message-----
>> From: Kempczynski, Zbigniew <zbigniew.kempczynski at intel.com>
>> Sent: Friday, January 13, 2023 5:01 PM
>> To: B, Jeevan <jeevan.b at intel.com>
>> Cc: igt-dev at lists.freedesktop.org; De Marchi, Lucas
>> <lucas.demarchi at intel.com>; kamil.konieczny at linux.intel.com
>> Subject: Re: [PATCH 2/2] lib/igt_draw: Add MOCS values for MTL
>>
>> On Fri, Jan 13, 2023 at 02:40:41PM +0530, Jeevan B wrote:
>> > On MTL, we want the table entry labelled "UC (GO:Mem)"
>> > which has index 5.  This means that the MOCS value is 10.
>> >
>> > Signed-off-by: Jeevan B <jeevan.b at intel.com>
>> > ---
>> >  lib/i915/intel_mocs.c | 12 ++++++++----
>> >  1 file changed, 8 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/lib/i915/intel_mocs.c b/lib/i915/intel_mocs.c index
>> > df541ab0..95f0fbde 100644
>> > --- a/lib/i915/intel_mocs.c
>> > +++ b/lib/i915/intel_mocs.c
>> > @@ -11,6 +11,8 @@
>> >  #define DG1_MOCS_WB_IDX				5
>> >  #define DG2_MOCS_UC_IDX				1
>> >  #define DG2_MOCS_WB_IDX				3
>> > +#define MTL_MOCS_UC_IDX				5
>> > +#define MTL_MOCS_WB_IDX				10
>> >  #define GEN12_MOCS_UC_IDX			3
>> >  #define GEN12_MOCS_WB_IDX			2
>> >  #define XY_BLOCK_COPY_BLT_MOCS_SHIFT		21
>> > @@ -32,13 +34,15 @@ static void get_mocs_index(int fd, struct
>> drm_i915_mocs_index *mocs)
>> >  	 * This helper function is providing current UC as well
>> >  	 * as WB MOCS index based on platform.
>> >  	 */
>> > -	if (IS_DG1(devid)) {
>> > -		mocs->uc_index = DG1_MOCS_UC_IDX;
>> > -		mocs->wb_index = DG1_MOCS_WB_IDX;
>>
>> Is this reorder necessary? I would just add MTL else if condition (unless you'll
>> convince me it makes sense).
>>
>> --
>> Zbigniew
>Hi Zbigniew,
>
>convention is latest platform first,
>MTL
>DG2
>DG1
>GEN12
>So I have reordered.

yep, that is correct. Lately I've seen people merging patches not
following this convention so we need to fix that up.

Lucas De Marchi

>
>Thanks
>Jeevan B
>
>>
>> > +	if (IS_METEORLAKE(devid)) {
>> > +		mocs->uc_index = MTL_MOCS_UC_IDX;
>> > +		mocs->wb_index = MTL_MOCS_WB_IDX;
>> >  	} else if (IS_DG2(devid)) {
>> >  		mocs->uc_index = DG2_MOCS_UC_IDX;
>> >  		mocs->wb_index = DG2_MOCS_WB_IDX;
>> > -
>> > +	} else if (IS_DG1(devid)) {
>> > +		mocs->uc_index = DG1_MOCS_UC_IDX;
>> > +		mocs->wb_index = DG1_MOCS_WB_IDX;
>> >  	} else if (IS_GEN12(devid)) {
>> >  		mocs->uc_index = GEN12_MOCS_UC_IDX;
>> >  		mocs->wb_index = GEN12_MOCS_WB_IDX;
>> > --
>> > 2.19.1
>> >


More information about the igt-dev mailing list