[Intel-gfx] [PATCH 1/1] drm/i915/mtl: enable local stolen memory

Lucas De Marchi lucas.demarchi at intel.com
Tue Sep 20 20:01:59 UTC 2022


On Tue, Sep 20, 2022 at 06:57:46PM +0200, Andi Shyti wrote:
>Hi Aravind,
>
>> +static int get_mtl_gms_size(struct intel_uncore *uncore)
>> +{
>> +	u16 ggc, gms;
>> +
>> +	ggc = intel_uncore_read16(uncore, _MMIO(0x108040));
>> +
>> +	/* check GGMS, should be fixed 0x3 (8MB) */
>> +	if ((ggc & 0xc0) != 0xc0)
>> +		return -EIO;
>> +
>> +	/* return valid GMS value, -EIO if invalid */
>> +	gms = ggc >> 8;
>> +	switch (gms) {
>> +	case 0x0 ... 0x10:
>> +		return gms * 32;
>> +	case 0x20:
>> +		return 1024;
>> +	case 0x30:
>> +		return 1536;
>> +	case 0x40:
>> +		return 2048;
>> +	case 0xf0 ... 0xfe:
>
>just a bit puzzled by the fact that case ranges are not standard
>and are supported only by GCC, unless, of course, I miss

clang also supports it and can build the kernel (or a great portion of
it).

Lucas De Marchi


More information about the Intel-gfx mailing list