diff mbox series

[v3,08/11] drm/panfrost: Add the MT8192 GPU ID

Message ID 20230223133440.80941-9-angelogioacchino.delregno@collabora.com (mailing list archive)
State New, archived
Headers show
Series Panfrost: Improve and add MediaTek SoCs support | expand

Commit Message

AngeloGioacchino Del Regno Feb. 23, 2023, 1:34 p.m. UTC
From: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>

MediaTek MT8192 has a Mali-G57 with a special GPU ID. Add its GPU ID,
but treat it as otherwise identical to a standard Mali-G57.

We do _not_ fix up the GPU ID here -- userspace needs to be aware of the
special GPU ID, in case we find functional differences between
MediaTek's implementation and the standard Mali-G57 down the line.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
---
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Chen-Yu Tsai Feb. 24, 2023, 10:06 a.m. UTC | #1
On Thu, Feb 23, 2023 at 9:35 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> From: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
>
> MediaTek MT8192 has a Mali-G57 with a special GPU ID. Add its GPU ID,
> but treat it as otherwise identical to a standard Mali-G57.
>
> We do _not_ fix up the GPU ID here -- userspace needs to be aware of the
> special GPU ID, in case we find functional differences between
> MediaTek's implementation and the standard Mali-G57 down the line.
>
> Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Reviewed-by: Steven Price <steven.price@arm.com>

Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>

As previously mentioned, MT8195 Mali G57 has minor revision number 1.
Do we need to handle that?

> ---
>  drivers/gpu/drm/panfrost/panfrost_gpu.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
> index 6452e4e900dd..d28b99732dde 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
> @@ -204,6 +204,14 @@ static const struct panfrost_model gpu_models[] = {
>
>         GPU_MODEL(g57, 0x9001,
>                 GPU_REV(g57, 0, 0)),
> +
> +       /* MediaTek MT8192 has a Mali-G57 with a different GPU ID from the
> +        * standard. Arm's driver does not appear to handle this model.
> +        * ChromeOS has a hack downstream for it. Treat it as equivalent to
> +        * standard Mali-G57 for now.
> +        */
> +       GPU_MODEL(g57, 0x9003,
> +               GPU_REV(g57, 0, 0)),
>  };
>
>  static void panfrost_gpu_init_features(struct panfrost_device *pfdev)
> --
> 2.39.2
>
AngeloGioacchino Del Regno Feb. 24, 2023, 1:08 p.m. UTC | #2
Il 24/02/23 11:06, Chen-Yu Tsai ha scritto:
> On Thu, Feb 23, 2023 at 9:35 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> From: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
>>
>> MediaTek MT8192 has a Mali-G57 with a special GPU ID. Add its GPU ID,
>> but treat it as otherwise identical to a standard Mali-G57.
>>
>> We do _not_ fix up the GPU ID here -- userspace needs to be aware of the
>> special GPU ID, in case we find functional differences between
>> MediaTek's implementation and the standard Mali-G57 down the line.
>>
>> Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> Reviewed-by: Steven Price <steven.price@arm.com>
> 
> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
> 
> As previously mentioned, MT8195 Mali G57 has minor revision number 1.
> Do we need to handle that?
> 

Maybe something went wrong while sending the reply to the same question on v2?

Anyway, from what I can see on my MT8195 machine, it works fine without adding
any particular handling...

Alyssa, Steven,
are you aware of anything that we should consider?

Regards,
Angelo

>> ---
>>   drivers/gpu/drm/panfrost/panfrost_gpu.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
>> index 6452e4e900dd..d28b99732dde 100644
>> --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
>> +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
>> @@ -204,6 +204,14 @@ static const struct panfrost_model gpu_models[] = {
>>
>>          GPU_MODEL(g57, 0x9001,
>>                  GPU_REV(g57, 0, 0)),
>> +
>> +       /* MediaTek MT8192 has a Mali-G57 with a different GPU ID from the
>> +        * standard. Arm's driver does not appear to handle this model.
>> +        * ChromeOS has a hack downstream for it. Treat it as equivalent to
>> +        * standard Mali-G57 for now.
>> +        */
>> +       GPU_MODEL(g57, 0x9003,
>> +               GPU_REV(g57, 0, 0)),
>>   };
>>
>>   static void panfrost_gpu_init_features(struct panfrost_device *pfdev)
>> --
>> 2.39.2
>>
Steven Price Feb. 24, 2023, 1:53 p.m. UTC | #3
On 24/02/2023 13:08, AngeloGioacchino Del Regno wrote:
> Il 24/02/23 11:06, Chen-Yu Tsai ha scritto:
>> On Thu, Feb 23, 2023 at 9:35 PM AngeloGioacchino Del Regno
>> <angelogioacchino.delregno@collabora.com> wrote:
>>>
>>> From: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
>>>
>>> MediaTek MT8192 has a Mali-G57 with a special GPU ID. Add its GPU ID,
>>> but treat it as otherwise identical to a standard Mali-G57.
>>>
>>> We do _not_ fix up the GPU ID here -- userspace needs to be aware of the
>>> special GPU ID, in case we find functional differences between
>>> MediaTek's implementation and the standard Mali-G57 down the line.
>>>
>>> Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
>>> Signed-off-by: AngeloGioacchino Del Regno
>>> <angelogioacchino.delregno@collabora.com>
>>> Reviewed-by: Steven Price <steven.price@arm.com>
>>
>> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
>>
>> As previously mentioned, MT8195 Mali G57 has minor revision number 1.
>> Do we need to handle that?
>>
> 
> Maybe something went wrong while sending the reply to the same question
> on v2?
> 
> Anyway, from what I can see on my MT8195 machine, it works fine without
> adding
> any particular handling...
> 
> Alyssa, Steven,
> are you aware of anything that we should consider?

The minor revision means that the set of HW workarounds might be
different. Specifically it appears that "BASE_HW_ISSUE_TTRX_3485"
applies to G57 ('Natt') r0p0 but not r0p1.

That particular workaround is a horrendous "dummy job" in kbase and we
don't have an implementation in Panfrost. However Panfrost also doesn't
(yet[1]) proactively SOFT_STOP jobs so is also unlikely to be affected.

TLDR; Minor revision 1 has a HW bug fixed, Panfrost isn't affected by
the bug anyway.

Steve

[1] It's been on my todo list for a while to look at improving job
scheduling, but to be honest I doubt I'm going to get round to it with
Panfrost, and PanCSF obviously changes the job scheduling anyway.

> Regards,
> Angelo
> 
>>> ---
>>>   drivers/gpu/drm/panfrost/panfrost_gpu.c | 8 ++++++++
>>>   1 file changed, 8 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c
>>> b/drivers/gpu/drm/panfrost/panfrost_gpu.c
>>> index 6452e4e900dd..d28b99732dde 100644
>>> --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
>>> +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
>>> @@ -204,6 +204,14 @@ static const struct panfrost_model gpu_models[] = {
>>>
>>>          GPU_MODEL(g57, 0x9001,
>>>                  GPU_REV(g57, 0, 0)),
>>> +
>>> +       /* MediaTek MT8192 has a Mali-G57 with a different GPU ID
>>> from the
>>> +        * standard. Arm's driver does not appear to handle this model.
>>> +        * ChromeOS has a hack downstream for it. Treat it as
>>> equivalent to
>>> +        * standard Mali-G57 for now.
>>> +        */
>>> +       GPU_MODEL(g57, 0x9003,
>>> +               GPU_REV(g57, 0, 0)),
>>>   };
>>>
>>>   static void panfrost_gpu_init_features(struct panfrost_device *pfdev)
>>> -- 
>>> 2.39.2
>>>
> 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
index 6452e4e900dd..d28b99732dde 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -204,6 +204,14 @@  static const struct panfrost_model gpu_models[] = {
 
 	GPU_MODEL(g57, 0x9001,
 		GPU_REV(g57, 0, 0)),
+
+	/* MediaTek MT8192 has a Mali-G57 with a different GPU ID from the
+	 * standard. Arm's driver does not appear to handle this model.
+	 * ChromeOS has a hack downstream for it. Treat it as equivalent to
+	 * standard Mali-G57 for now.
+	 */
+	GPU_MODEL(g57, 0x9003,
+		GPU_REV(g57, 0, 0)),
 };
 
 static void panfrost_gpu_init_features(struct panfrost_device *pfdev)