* [PATCH v2 0/2] Support for Adreno 612 GPU
@ 2024-11-25 16:32 Akhil P Oommen
2024-11-25 16:33 ` [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE Akhil P Oommen
2024-11-25 16:33 ` [PATCH v2 2/2] drm/msm/a6xx: Add support for Adreno 612 Akhil P Oommen
0 siblings, 2 replies; 11+ messages in thread
From: Akhil P Oommen @ 2024-11-25 16:32 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar,
Dmitry Baryshkov, Marijn Suijten, David Airlie, Simona Vetter
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
Akhil P Oommen, Jie Zhang, Konrad Dybcio
Mesa support is already available for A612. Verified Glmark2 with
weston.
Some dependencies for the devicetree change are not yet available
in the mailing lists. I will send it out as a separate patch later.
In v2 of this series, there is a new patch to check the LLC support
by using a new QUIRK flag. This is required now because A612 is the
first gpu which has gmu_wrapper along with LLC support.
---
Changes in v2:
- Added a new quirk to check LLC support (new patch). This helps to
correct LLC handling in A612's patch.
- Rebased on msm-next tip
- Captured R-b from Konrad
- Link to v1: https://lore.kernel.org/r/20241101-a612-gpu-support-v1-1-bdfe8f6d9306@quicinc.com
---
Akhil P Oommen (1):
drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE
Jie Zhang (1):
drm/msm/a6xx: Add support for Adreno 612
drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 18 ++++++++++++-
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 42 ++++++++++++++++++++-----------
drivers/gpu/drm/msm/adreno/adreno_gpu.h | 12 ++++++---
3 files changed, 54 insertions(+), 18 deletions(-)
---
base-commit: f4a867a46862c1743501bbe8c813238456ec8699
change-id: 20241031-a612-gpu-support-d6330f17d01f
Best regards,
--
Akhil P Oommen <quic_akhilpo@quicinc.com>
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE 2024-11-25 16:32 [PATCH v2 0/2] Support for Adreno 612 GPU Akhil P Oommen @ 2024-11-25 16:33 ` Akhil P Oommen 2024-11-25 16:46 ` Dmitry Baryshkov 2024-11-30 13:31 ` Konrad Dybcio 2024-11-25 16:33 ` [PATCH v2 2/2] drm/msm/a6xx: Add support for Adreno 612 Akhil P Oommen 1 sibling, 2 replies; 11+ messages in thread From: Akhil P Oommen @ 2024-11-25 16:33 UTC (permalink / raw) To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar, Dmitry Baryshkov, Marijn Suijten, David Airlie, Simona Vetter Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Akhil P Oommen There are a few chipsets which don't have system cache a.k.a LLC. Currently, the assumption in the driver is that the system cache availability correlates with the presence of GMU or RPMH, which is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU with a full blown GMU, but doesnot have a system cache. So, introduce an Adreno Quirk flag to check support for system cache instead of using gmu_wrapper flag. Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> --- drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +------ drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c index 0c560e84ad5a..5e389f6b8b8a 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c @@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = { }, .gmem = (SZ_128K + SZ_4K), .inactive_period = DRM_MSM_INACTIVE_PERIOD, + .quirks = ADRENO_QUIRK_NO_SYSCACHE, .init = a6xx_gpu_init, .zapfw = "a610_zap.mdt", .a6xx = &(const struct a6xx_info) { @@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = { }, .gmem = SZ_128K, .inactive_period = DRM_MSM_INACTIVE_PERIOD, - .quirks = ADRENO_QUIRK_HAS_HW_APRIV, + .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE, .init = a6xx_gpu_init, .zapfw = "a702_zap.mbn", .a6xx = &(const struct a6xx_info) { diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 019610341df1..a8b928d0f320 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu) static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) { - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) - return; - llcc_slice_putd(a6xx_gpu->llc_slice); llcc_slice_putd(a6xx_gpu->htw_llc_slice); } @@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev, { struct device_node *phandle; - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) + if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE) return; /* diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h index e71f420f8b3a..398be2218110 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -57,6 +57,7 @@ enum adreno_family { #define ADRENO_QUIRK_HAS_HW_APRIV BIT(3) #define ADRENO_QUIRK_HAS_CACHED_COHERENT BIT(4) #define ADRENO_QUIRK_PREEMPTION BIT(5) +#define ADRENO_QUIRK_NO_SYSCACHE BIT(6) /* Helper for formating the chip_id in the way that userspace tools like * crashdec expect. -- 2.45.2 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE 2024-11-25 16:33 ` [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE Akhil P Oommen @ 2024-11-25 16:46 ` Dmitry Baryshkov 2024-11-30 13:31 ` Konrad Dybcio 1 sibling, 0 replies; 11+ messages in thread From: Dmitry Baryshkov @ 2024-11-25 16:46 UTC (permalink / raw) To: Akhil P Oommen Cc: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel On Mon, Nov 25, 2024 at 10:03:00PM +0530, Akhil P Oommen wrote: > There are a few chipsets which don't have system cache a.k.a LLC. > Currently, the assumption in the driver is that the system cache > availability correlates with the presence of GMU or RPMH, which > is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU > with a full blown GMU, but doesnot have a system cache. So, > introduce an Adreno Quirk flag to check support for system cache > instead of using gmu_wrapper flag. > > Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> > --- > drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++- > drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +------ > drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + > 3 files changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > index 0c560e84ad5a..5e389f6b8b8a 100644 > --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > @@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = { > }, > .gmem = (SZ_128K + SZ_4K), > .inactive_period = DRM_MSM_INACTIVE_PERIOD, > + .quirks = ADRENO_QUIRK_NO_SYSCACHE, > .init = a6xx_gpu_init, > .zapfw = "a610_zap.mdt", > .a6xx = &(const struct a6xx_info) { > @@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = { > }, > .gmem = SZ_128K, > .inactive_period = DRM_MSM_INACTIVE_PERIOD, > - .quirks = ADRENO_QUIRK_HAS_HW_APRIV, > + .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE, > .init = a6xx_gpu_init, > .zapfw = "a702_zap.mbn", > .a6xx = &(const struct a6xx_info) { > diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > index 019610341df1..a8b928d0f320 100644 > --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > @@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu) > > static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) > { > - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ > - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) > - return; > - Shouldn't it also be a NO_SYSCACHE check? > llcc_slice_putd(a6xx_gpu->llc_slice); > llcc_slice_putd(a6xx_gpu->htw_llc_slice); > } > @@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev, > { > struct device_node *phandle; > > - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ > - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) > + if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE) > return; > > /* > diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h > index e71f420f8b3a..398be2218110 100644 > --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h > +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h > @@ -57,6 +57,7 @@ enum adreno_family { > #define ADRENO_QUIRK_HAS_HW_APRIV BIT(3) > #define ADRENO_QUIRK_HAS_CACHED_COHERENT BIT(4) > #define ADRENO_QUIRK_PREEMPTION BIT(5) > +#define ADRENO_QUIRK_NO_SYSCACHE BIT(6) > > /* Helper for formating the chip_id in the way that userspace tools like > * crashdec expect. > > -- > 2.45.2 > -- With best wishes Dmitry ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE 2024-11-25 16:33 ` [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE Akhil P Oommen 2024-11-25 16:46 ` Dmitry Baryshkov @ 2024-11-30 13:31 ` Konrad Dybcio 2024-11-30 20:30 ` Akhil P Oommen 1 sibling, 1 reply; 11+ messages in thread From: Konrad Dybcio @ 2024-11-30 13:31 UTC (permalink / raw) To: Akhil P Oommen, Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar, Dmitry Baryshkov, Marijn Suijten, David Airlie, Simona Vetter Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel On 25.11.2024 5:33 PM, Akhil P Oommen wrote: > There are a few chipsets which don't have system cache a.k.a LLC. > Currently, the assumption in the driver is that the system cache > availability correlates with the presence of GMU or RPMH, which > is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU > with a full blown GMU, but doesnot have a system cache. So, > introduce an Adreno Quirk flag to check support for system cache > instead of using gmu_wrapper flag. > > Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> > --- > drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++- > drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +------ > drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + > 3 files changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > index 0c560e84ad5a..5e389f6b8b8a 100644 > --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > @@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = { > }, > .gmem = (SZ_128K + SZ_4K), > .inactive_period = DRM_MSM_INACTIVE_PERIOD, > + .quirks = ADRENO_QUIRK_NO_SYSCACHE, > .init = a6xx_gpu_init, > .zapfw = "a610_zap.mdt", > .a6xx = &(const struct a6xx_info) { > @@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = { > }, > .gmem = SZ_128K, > .inactive_period = DRM_MSM_INACTIVE_PERIOD, > - .quirks = ADRENO_QUIRK_HAS_HW_APRIV, > + .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE, > .init = a6xx_gpu_init, > .zapfw = "a702_zap.mbn", > .a6xx = &(const struct a6xx_info) { +a619_holi > diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > index 019610341df1..a8b928d0f320 100644 > --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > @@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu) > > static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) > { > - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ > - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) > - return; > - > llcc_slice_putd(a6xx_gpu->llc_slice); > llcc_slice_putd(a6xx_gpu->htw_llc_slice); > } > @@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev, > { > struct device_node *phandle; > > - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ > - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) > + if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE) > return; I think A612 is the "quirky" one here.. it has some sort of a GMU, but we're choosing not to implement it. maybe a check for if (adreno_has_gmu_wrapper && !adreno_is_a612) would be clearer here, with a comment that RGMU support is not implemented But going further, I'm a bit concerned about dt-bindings.. If we implement RGMU on the driver side in the future, that will require DT changes which will make the currently proposed description invalid. I think a better angle would be to add a adreno_has_rgmu() func with a qcom,adreno-rgmu compatible and plumb it correctly from the get-go. This way, we can avoid this syscache quirk as well. Konrad ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE 2024-11-30 13:31 ` Konrad Dybcio @ 2024-11-30 20:30 ` Akhil P Oommen 2024-12-01 16:36 ` Rob Clark 0 siblings, 1 reply; 11+ messages in thread From: Akhil P Oommen @ 2024-11-30 20:30 UTC (permalink / raw) To: Konrad Dybcio, Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar, Dmitry Baryshkov, Marijn Suijten, David Airlie, Simona Vetter Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel On 11/30/2024 7:01 PM, Konrad Dybcio wrote: > On 25.11.2024 5:33 PM, Akhil P Oommen wrote: >> There are a few chipsets which don't have system cache a.k.a LLC. >> Currently, the assumption in the driver is that the system cache >> availability correlates with the presence of GMU or RPMH, which >> is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU >> with a full blown GMU, but doesnot have a system cache. So, >> introduce an Adreno Quirk flag to check support for system cache >> instead of using gmu_wrapper flag. >> >> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> >> --- >> drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++- >> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +------ >> drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + >> 3 files changed, 4 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c >> index 0c560e84ad5a..5e389f6b8b8a 100644 >> --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c >> +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c >> @@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = { >> }, >> .gmem = (SZ_128K + SZ_4K), >> .inactive_period = DRM_MSM_INACTIVE_PERIOD, >> + .quirks = ADRENO_QUIRK_NO_SYSCACHE, >> .init = a6xx_gpu_init, >> .zapfw = "a610_zap.mdt", >> .a6xx = &(const struct a6xx_info) { >> @@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = { >> }, >> .gmem = SZ_128K, >> .inactive_period = DRM_MSM_INACTIVE_PERIOD, >> - .quirks = ADRENO_QUIRK_HAS_HW_APRIV, >> + .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE, >> .init = a6xx_gpu_init, >> .zapfw = "a702_zap.mbn", >> .a6xx = &(const struct a6xx_info) { > > +a619_holi > >> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c >> index 019610341df1..a8b928d0f320 100644 >> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c >> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c >> @@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu) >> >> static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) >> { >> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ >> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) >> - return; >> - >> llcc_slice_putd(a6xx_gpu->llc_slice); >> llcc_slice_putd(a6xx_gpu->htw_llc_slice); >> } >> @@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev, >> { >> struct device_node *phandle; >> >> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ >> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) >> + if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE) >> return; > > I think A612 is the "quirky" one here.. it has some sort of a GMU, > but we're choosing not to implement it. maybe a check for > > if (adreno_has_gmu_wrapper && !adreno_is_a612) > > would be clearer here, with a comment that RGMU support is not > implemented > > > > But going further, I'm a bit concerned about dt-bindings.. If we > implement RGMU on the driver side in the future, that will require > DT changes which will make the currently proposed description invalid. > > I think a better angle would be to add a adreno_has_rgmu() func with > a qcom,adreno-rgmu compatible and plumb it correctly from the get-go. > > This way, we can avoid this syscache quirk as well. > I am aware of at least Adreno 710 which doesn't have syscache, but has proper GMU. And I don't see any reason why there couldn't be another one in future to save silicon area. So, a quirk flag doesn't seem so bad in this case. The correct way to avoid this quirk flag is by making LLCC driver return a proper error to detect the absence of syscache. Currently, it just returns EPROBE_DEFER which put driver in an infinite probe loop. Agree about the dt binding suggestion. I will define a new compatible string for rgmu. -Akhil. > Konrad ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE 2024-11-30 20:30 ` Akhil P Oommen @ 2024-12-01 16:36 ` Rob Clark 2024-12-04 19:03 ` Akhil P Oommen 0 siblings, 1 reply; 11+ messages in thread From: Rob Clark @ 2024-12-01 16:36 UTC (permalink / raw) To: Akhil P Oommen Cc: Konrad Dybcio, Sean Paul, Konrad Dybcio, Abhinav Kumar, Dmitry Baryshkov, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel, Rob Clark On Sat, Nov 30, 2024 at 12:30 PM Akhil P Oommen <quic_akhilpo@quicinc.com> wrote: > > On 11/30/2024 7:01 PM, Konrad Dybcio wrote: > > On 25.11.2024 5:33 PM, Akhil P Oommen wrote: > >> There are a few chipsets which don't have system cache a.k.a LLC. > >> Currently, the assumption in the driver is that the system cache > >> availability correlates with the presence of GMU or RPMH, which > >> is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU > >> with a full blown GMU, but doesnot have a system cache. So, > >> introduce an Adreno Quirk flag to check support for system cache > >> instead of using gmu_wrapper flag. > >> > >> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> > >> --- > >> drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++- > >> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +------ > >> drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + > >> 3 files changed, 4 insertions(+), 7 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > >> index 0c560e84ad5a..5e389f6b8b8a 100644 > >> --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > >> +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > >> @@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = { > >> }, > >> .gmem = (SZ_128K + SZ_4K), > >> .inactive_period = DRM_MSM_INACTIVE_PERIOD, > >> + .quirks = ADRENO_QUIRK_NO_SYSCACHE, > >> .init = a6xx_gpu_init, > >> .zapfw = "a610_zap.mdt", > >> .a6xx = &(const struct a6xx_info) { > >> @@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = { > >> }, > >> .gmem = SZ_128K, > >> .inactive_period = DRM_MSM_INACTIVE_PERIOD, > >> - .quirks = ADRENO_QUIRK_HAS_HW_APRIV, > >> + .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE, > >> .init = a6xx_gpu_init, > >> .zapfw = "a702_zap.mbn", > >> .a6xx = &(const struct a6xx_info) { > > > > +a619_holi > > > >> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > >> index 019610341df1..a8b928d0f320 100644 > >> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > >> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > >> @@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu) > >> > >> static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) > >> { > >> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ > >> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) > >> - return; > >> - > >> llcc_slice_putd(a6xx_gpu->llc_slice); > >> llcc_slice_putd(a6xx_gpu->htw_llc_slice); > >> } > >> @@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev, > >> { > >> struct device_node *phandle; > >> > >> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ > >> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) > >> + if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE) > >> return; > > > > I think A612 is the "quirky" one here.. it has some sort of a GMU, > > but we're choosing not to implement it. maybe a check for > > > > if (adreno_has_gmu_wrapper && !adreno_is_a612) > > > > would be clearer here, with a comment that RGMU support is not > > implemented > > > > > > > > But going further, I'm a bit concerned about dt-bindings.. If we > > implement RGMU on the driver side in the future, that will require > > DT changes which will make the currently proposed description invalid. > > > > I think a better angle would be to add a adreno_has_rgmu() func with > > a qcom,adreno-rgmu compatible and plumb it correctly from the get-go. > > > > This way, we can avoid this syscache quirk as well. > > > > I am aware of at least Adreno 710 which doesn't have syscache, but has > proper GMU. And I don't see any reason why there couldn't be another one > in future to save silicon area. So, a quirk flag doesn't seem so bad in > this case. > > The correct way to avoid this quirk flag is by making LLCC driver return > a proper error to detect the absence of syscache. Currently, it just > returns EPROBE_DEFER which put driver in an infinite probe loop. Hmm, this seems solvable? llcc has a node in the dt, so it seems like it should be able to tell the difference between not existing and not being probed yet. Something maybe like, initialize drv_data to NULL instead of -EPROBE_DEFER, and then in the various entry points, if (!drv_data) return not_probed_helper(); which would check if a compatible node exists in dt? BR, -R > Agree about the dt binding suggestion. I will define a new compatible > string for rgmu. > > -Akhil. > > > Konrad > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE 2024-12-01 16:36 ` Rob Clark @ 2024-12-04 19:03 ` Akhil P Oommen 2024-12-04 21:47 ` Rob Clark 0 siblings, 1 reply; 11+ messages in thread From: Akhil P Oommen @ 2024-12-04 19:03 UTC (permalink / raw) To: Rob Clark Cc: Konrad Dybcio, Sean Paul, Konrad Dybcio, Abhinav Kumar, Dmitry Baryshkov, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel, Rob Clark On 12/1/2024 10:06 PM, Rob Clark wrote: > On Sat, Nov 30, 2024 at 12:30 PM Akhil P Oommen > <quic_akhilpo@quicinc.com> wrote: >> >> On 11/30/2024 7:01 PM, Konrad Dybcio wrote: >>> On 25.11.2024 5:33 PM, Akhil P Oommen wrote: >>>> There are a few chipsets which don't have system cache a.k.a LLC. >>>> Currently, the assumption in the driver is that the system cache >>>> availability correlates with the presence of GMU or RPMH, which >>>> is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU >>>> with a full blown GMU, but doesnot have a system cache. So, >>>> introduce an Adreno Quirk flag to check support for system cache >>>> instead of using gmu_wrapper flag. >>>> >>>> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> >>>> --- >>>> drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++- >>>> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +------ >>>> drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + >>>> 3 files changed, 4 insertions(+), 7 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c >>>> index 0c560e84ad5a..5e389f6b8b8a 100644 >>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c >>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c >>>> @@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = { >>>> }, >>>> .gmem = (SZ_128K + SZ_4K), >>>> .inactive_period = DRM_MSM_INACTIVE_PERIOD, >>>> + .quirks = ADRENO_QUIRK_NO_SYSCACHE, >>>> .init = a6xx_gpu_init, >>>> .zapfw = "a610_zap.mdt", >>>> .a6xx = &(const struct a6xx_info) { >>>> @@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = { >>>> }, >>>> .gmem = SZ_128K, >>>> .inactive_period = DRM_MSM_INACTIVE_PERIOD, >>>> - .quirks = ADRENO_QUIRK_HAS_HW_APRIV, >>>> + .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE, >>>> .init = a6xx_gpu_init, >>>> .zapfw = "a702_zap.mbn", >>>> .a6xx = &(const struct a6xx_info) { >>> >>> +a619_holi >>> >>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c >>>> index 019610341df1..a8b928d0f320 100644 >>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c >>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c >>>> @@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu) >>>> >>>> static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) >>>> { >>>> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ >>>> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) >>>> - return; >>>> - >>>> llcc_slice_putd(a6xx_gpu->llc_slice); >>>> llcc_slice_putd(a6xx_gpu->htw_llc_slice); >>>> } >>>> @@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev, >>>> { >>>> struct device_node *phandle; >>>> >>>> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ >>>> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) >>>> + if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE) >>>> return; >>> >>> I think A612 is the "quirky" one here.. it has some sort of a GMU, >>> but we're choosing not to implement it. maybe a check for >>> >>> if (adreno_has_gmu_wrapper && !adreno_is_a612) >>> >>> would be clearer here, with a comment that RGMU support is not >>> implemented >>> >>> >>> >>> But going further, I'm a bit concerned about dt-bindings.. If we >>> implement RGMU on the driver side in the future, that will require >>> DT changes which will make the currently proposed description invalid. >>> >>> I think a better angle would be to add a adreno_has_rgmu() func with >>> a qcom,adreno-rgmu compatible and plumb it correctly from the get-go. >>> >>> This way, we can avoid this syscache quirk as well. >>> >> >> I am aware of at least Adreno 710 which doesn't have syscache, but has >> proper GMU. And I don't see any reason why there couldn't be another one >> in future to save silicon area. So, a quirk flag doesn't seem so bad in >> this case. >> >> The correct way to avoid this quirk flag is by making LLCC driver return >> a proper error to detect the absence of syscache. Currently, it just >> returns EPROBE_DEFER which put driver in an infinite probe loop. > > Hmm, this seems solvable? llcc has a node in the dt, so it seems like > it should be able to tell the difference between not existing and not > being probed yet. Something maybe like, initialize drv_data to NULL > instead of -EPROBE_DEFER, and then in the various entry points, if > (!drv_data) return not_probed_helper(); which would check if a > compatible node exists in dt? Sounds like that would work. Can we explore that separately? I am a bit worried about adding another subsystem's patch to this series. That might delay this series by weeks. -Akhil > > BR, > -R > >> Agree about the dt binding suggestion. I will define a new compatible >> string for rgmu. >> >> -Akhil. >> >>> Konrad >> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE 2024-12-04 19:03 ` Akhil P Oommen @ 2024-12-04 21:47 ` Rob Clark 2024-12-04 21:50 ` Rob Clark 0 siblings, 1 reply; 11+ messages in thread From: Rob Clark @ 2024-12-04 21:47 UTC (permalink / raw) To: Akhil P Oommen Cc: Konrad Dybcio, Sean Paul, Konrad Dybcio, Abhinav Kumar, Dmitry Baryshkov, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel, Rob Clark On Wed, Dec 4, 2024 at 11:04 AM Akhil P Oommen <quic_akhilpo@quicinc.com> wrote: > > On 12/1/2024 10:06 PM, Rob Clark wrote: > > On Sat, Nov 30, 2024 at 12:30 PM Akhil P Oommen > > <quic_akhilpo@quicinc.com> wrote: > >> > >> On 11/30/2024 7:01 PM, Konrad Dybcio wrote: > >>> On 25.11.2024 5:33 PM, Akhil P Oommen wrote: > >>>> There are a few chipsets which don't have system cache a.k.a LLC. > >>>> Currently, the assumption in the driver is that the system cache > >>>> availability correlates with the presence of GMU or RPMH, which > >>>> is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU > >>>> with a full blown GMU, but doesnot have a system cache. So, > >>>> introduce an Adreno Quirk flag to check support for system cache > >>>> instead of using gmu_wrapper flag. > >>>> > >>>> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> > >>>> --- > >>>> drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++- > >>>> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +------ > >>>> drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + > >>>> 3 files changed, 4 insertions(+), 7 deletions(-) > >>>> > >>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > >>>> index 0c560e84ad5a..5e389f6b8b8a 100644 > >>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > >>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > >>>> @@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = { > >>>> }, > >>>> .gmem = (SZ_128K + SZ_4K), > >>>> .inactive_period = DRM_MSM_INACTIVE_PERIOD, > >>>> + .quirks = ADRENO_QUIRK_NO_SYSCACHE, > >>>> .init = a6xx_gpu_init, > >>>> .zapfw = "a610_zap.mdt", > >>>> .a6xx = &(const struct a6xx_info) { > >>>> @@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = { > >>>> }, > >>>> .gmem = SZ_128K, > >>>> .inactive_period = DRM_MSM_INACTIVE_PERIOD, > >>>> - .quirks = ADRENO_QUIRK_HAS_HW_APRIV, > >>>> + .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE, > >>>> .init = a6xx_gpu_init, > >>>> .zapfw = "a702_zap.mbn", > >>>> .a6xx = &(const struct a6xx_info) { > >>> > >>> +a619_holi > >>> > >>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > >>>> index 019610341df1..a8b928d0f320 100644 > >>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > >>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > >>>> @@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu) > >>>> > >>>> static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) > >>>> { > >>>> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ > >>>> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) > >>>> - return; > >>>> - > >>>> llcc_slice_putd(a6xx_gpu->llc_slice); > >>>> llcc_slice_putd(a6xx_gpu->htw_llc_slice); > >>>> } > >>>> @@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev, > >>>> { > >>>> struct device_node *phandle; > >>>> > >>>> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ > >>>> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) > >>>> + if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE) > >>>> return; > >>> > >>> I think A612 is the "quirky" one here.. it has some sort of a GMU, > >>> but we're choosing not to implement it. maybe a check for > >>> > >>> if (adreno_has_gmu_wrapper && !adreno_is_a612) > >>> > >>> would be clearer here, with a comment that RGMU support is not > >>> implemented > >>> > >>> > >>> > >>> But going further, I'm a bit concerned about dt-bindings.. If we > >>> implement RGMU on the driver side in the future, that will require > >>> DT changes which will make the currently proposed description invalid. > >>> > >>> I think a better angle would be to add a adreno_has_rgmu() func with > >>> a qcom,adreno-rgmu compatible and plumb it correctly from the get-go. > >>> > >>> This way, we can avoid this syscache quirk as well. > >>> > >> > >> I am aware of at least Adreno 710 which doesn't have syscache, but has > >> proper GMU. And I don't see any reason why there couldn't be another one > >> in future to save silicon area. So, a quirk flag doesn't seem so bad in > >> this case. > >> > >> The correct way to avoid this quirk flag is by making LLCC driver return > >> a proper error to detect the absence of syscache. Currently, it just > >> returns EPROBE_DEFER which put driver in an infinite probe loop. > > > > Hmm, this seems solvable? llcc has a node in the dt, so it seems like > > it should be able to tell the difference between not existing and not > > being probed yet. Something maybe like, initialize drv_data to NULL > > instead of -EPROBE_DEFER, and then in the various entry points, if > > (!drv_data) return not_probed_helper(); which would check if a > > compatible node exists in dt? > > Sounds like that would work. Can we explore that separately? > > I am a bit worried about adding another subsystem's patch to this > series. That might delay this series by weeks. I don't think there is a dependency between the two, so it shouldn't delay anything. We can just merge the first patch in this series as it is and drop the second. And the llcc change is a legit bug fix, IMO, -EPROBE_DEFER is the incorrect return value when the device is not present. BR, -R > -Akhil > > > > > BR, > > -R > > > >> Agree about the dt binding suggestion. I will define a new compatible > >> string for rgmu. > >> > >> -Akhil. > >> > >>> Konrad > >> > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE 2024-12-04 21:47 ` Rob Clark @ 2024-12-04 21:50 ` Rob Clark 2024-12-05 15:36 ` Akhil P Oommen 0 siblings, 1 reply; 11+ messages in thread From: Rob Clark @ 2024-12-04 21:50 UTC (permalink / raw) To: Akhil P Oommen Cc: Konrad Dybcio, Sean Paul, Konrad Dybcio, Abhinav Kumar, Dmitry Baryshkov, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel, Rob Clark On Wed, Dec 4, 2024 at 1:47 PM Rob Clark <robdclark@gmail.com> wrote: > > On Wed, Dec 4, 2024 at 11:04 AM Akhil P Oommen <quic_akhilpo@quicinc.com> wrote: > > > > On 12/1/2024 10:06 PM, Rob Clark wrote: > > > On Sat, Nov 30, 2024 at 12:30 PM Akhil P Oommen > > > <quic_akhilpo@quicinc.com> wrote: > > >> > > >> On 11/30/2024 7:01 PM, Konrad Dybcio wrote: > > >>> On 25.11.2024 5:33 PM, Akhil P Oommen wrote: > > >>>> There are a few chipsets which don't have system cache a.k.a LLC. > > >>>> Currently, the assumption in the driver is that the system cache > > >>>> availability correlates with the presence of GMU or RPMH, which > > >>>> is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU > > >>>> with a full blown GMU, but doesnot have a system cache. So, > > >>>> introduce an Adreno Quirk flag to check support for system cache > > >>>> instead of using gmu_wrapper flag. > > >>>> > > >>>> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> > > >>>> --- > > >>>> drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++- > > >>>> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +------ > > >>>> drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + > > >>>> 3 files changed, 4 insertions(+), 7 deletions(-) > > >>>> > > >>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > > >>>> index 0c560e84ad5a..5e389f6b8b8a 100644 > > >>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > > >>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c > > >>>> @@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = { > > >>>> }, > > >>>> .gmem = (SZ_128K + SZ_4K), > > >>>> .inactive_period = DRM_MSM_INACTIVE_PERIOD, > > >>>> + .quirks = ADRENO_QUIRK_NO_SYSCACHE, > > >>>> .init = a6xx_gpu_init, > > >>>> .zapfw = "a610_zap.mdt", > > >>>> .a6xx = &(const struct a6xx_info) { > > >>>> @@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = { > > >>>> }, > > >>>> .gmem = SZ_128K, > > >>>> .inactive_period = DRM_MSM_INACTIVE_PERIOD, > > >>>> - .quirks = ADRENO_QUIRK_HAS_HW_APRIV, > > >>>> + .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE, > > >>>> .init = a6xx_gpu_init, > > >>>> .zapfw = "a702_zap.mbn", > > >>>> .a6xx = &(const struct a6xx_info) { > > >>> > > >>> +a619_holi > > >>> > > >>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > > >>>> index 019610341df1..a8b928d0f320 100644 > > >>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > > >>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > > >>>> @@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu) > > >>>> > > >>>> static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) > > >>>> { > > >>>> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ > > >>>> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) > > >>>> - return; > > >>>> - > > >>>> llcc_slice_putd(a6xx_gpu->llc_slice); > > >>>> llcc_slice_putd(a6xx_gpu->htw_llc_slice); > > >>>> } > > >>>> @@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev, > > >>>> { > > >>>> struct device_node *phandle; > > >>>> > > >>>> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ > > >>>> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) > > >>>> + if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE) > > >>>> return; > > >>> > > >>> I think A612 is the "quirky" one here.. it has some sort of a GMU, > > >>> but we're choosing not to implement it. maybe a check for > > >>> > > >>> if (adreno_has_gmu_wrapper && !adreno_is_a612) > > >>> > > >>> would be clearer here, with a comment that RGMU support is not > > >>> implemented > > >>> > > >>> > > >>> > > >>> But going further, I'm a bit concerned about dt-bindings.. If we > > >>> implement RGMU on the driver side in the future, that will require > > >>> DT changes which will make the currently proposed description invalid. > > >>> > > >>> I think a better angle would be to add a adreno_has_rgmu() func with > > >>> a qcom,adreno-rgmu compatible and plumb it correctly from the get-go. > > >>> > > >>> This way, we can avoid this syscache quirk as well. > > >>> > > >> > > >> I am aware of at least Adreno 710 which doesn't have syscache, but has > > >> proper GMU. And I don't see any reason why there couldn't be another one > > >> in future to save silicon area. So, a quirk flag doesn't seem so bad in > > >> this case. > > >> > > >> The correct way to avoid this quirk flag is by making LLCC driver return > > >> a proper error to detect the absence of syscache. Currently, it just > > >> returns EPROBE_DEFER which put driver in an infinite probe loop. > > > > > > Hmm, this seems solvable? llcc has a node in the dt, so it seems like > > > it should be able to tell the difference between not existing and not > > > being probed yet. Something maybe like, initialize drv_data to NULL > > > instead of -EPROBE_DEFER, and then in the various entry points, if > > > (!drv_data) return not_probed_helper(); which would check if a > > > compatible node exists in dt? > > > > Sounds like that would work. Can we explore that separately? > > > > I am a bit worried about adding another subsystem's patch to this > > series. That might delay this series by weeks. > > I don't think there is a dependency between the two, so it shouldn't > delay anything. We can just merge the first patch in this series as > it is and drop the second. And the llcc change is a legit bug fix, > IMO, -EPROBE_DEFER is the incorrect return value when the device is > not present. Actually, that wasn't _quite_ correct, but the idea still stands. Re-send second patch, but without the ADRENO_QUIRK_NO_SYSCACHE parts, and drop the first. In parallel send the llcc fix. There is no compile time dependency, so they can go thru different trees. BR, -R > > BR, > -R > > > -Akhil > > > > > > > > BR, > > > -R > > > > > >> Agree about the dt binding suggestion. I will define a new compatible > > >> string for rgmu. > > >> > > >> -Akhil. > > >> > > >>> Konrad > > >> > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE 2024-12-04 21:50 ` Rob Clark @ 2024-12-05 15:36 ` Akhil P Oommen 0 siblings, 0 replies; 11+ messages in thread From: Akhil P Oommen @ 2024-12-05 15:36 UTC (permalink / raw) To: Rob Clark Cc: Konrad Dybcio, Sean Paul, Konrad Dybcio, Abhinav Kumar, Dmitry Baryshkov, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel, Rob Clark On 12/5/2024 3:20 AM, Rob Clark wrote: > On Wed, Dec 4, 2024 at 1:47 PM Rob Clark <robdclark@gmail.com> wrote: >> >> On Wed, Dec 4, 2024 at 11:04 AM Akhil P Oommen <quic_akhilpo@quicinc.com> wrote: >>> >>> On 12/1/2024 10:06 PM, Rob Clark wrote: >>>> On Sat, Nov 30, 2024 at 12:30 PM Akhil P Oommen >>>> <quic_akhilpo@quicinc.com> wrote: >>>>> >>>>> On 11/30/2024 7:01 PM, Konrad Dybcio wrote: >>>>>> On 25.11.2024 5:33 PM, Akhil P Oommen wrote: >>>>>>> There are a few chipsets which don't have system cache a.k.a LLC. >>>>>>> Currently, the assumption in the driver is that the system cache >>>>>>> availability correlates with the presence of GMU or RPMH, which >>>>>>> is not true. For instance, Snapdragon 6 Gen 1 has RPMH and a GPU >>>>>>> with a full blown GMU, but doesnot have a system cache. So, >>>>>>> introduce an Adreno Quirk flag to check support for system cache >>>>>>> instead of using gmu_wrapper flag. >>>>>>> >>>>>>> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> >>>>>>> --- >>>>>>> drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 3 ++- >>>>>>> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +------ >>>>>>> drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + >>>>>>> 3 files changed, 4 insertions(+), 7 deletions(-) >>>>>>> >>>>>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c >>>>>>> index 0c560e84ad5a..5e389f6b8b8a 100644 >>>>>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c >>>>>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c >>>>>>> @@ -682,6 +682,7 @@ static const struct adreno_info a6xx_gpus[] = { >>>>>>> }, >>>>>>> .gmem = (SZ_128K + SZ_4K), >>>>>>> .inactive_period = DRM_MSM_INACTIVE_PERIOD, >>>>>>> + .quirks = ADRENO_QUIRK_NO_SYSCACHE, >>>>>>> .init = a6xx_gpu_init, >>>>>>> .zapfw = "a610_zap.mdt", >>>>>>> .a6xx = &(const struct a6xx_info) { >>>>>>> @@ -1331,7 +1332,7 @@ static const struct adreno_info a7xx_gpus[] = { >>>>>>> }, >>>>>>> .gmem = SZ_128K, >>>>>>> .inactive_period = DRM_MSM_INACTIVE_PERIOD, >>>>>>> - .quirks = ADRENO_QUIRK_HAS_HW_APRIV, >>>>>>> + .quirks = ADRENO_QUIRK_HAS_HW_APRIV | ADRENO_QUIRK_NO_SYSCACHE, >>>>>>> .init = a6xx_gpu_init, >>>>>>> .zapfw = "a702_zap.mbn", >>>>>>> .a6xx = &(const struct a6xx_info) { >>>>>> >>>>>> +a619_holi >>>>>> >>>>>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c >>>>>>> index 019610341df1..a8b928d0f320 100644 >>>>>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c >>>>>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c >>>>>>> @@ -1863,10 +1863,6 @@ static void a7xx_llc_activate(struct a6xx_gpu *a6xx_gpu) >>>>>>> >>>>>>> static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) >>>>>>> { >>>>>>> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ >>>>>>> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) >>>>>>> - return; >>>>>>> - >>>>>>> llcc_slice_putd(a6xx_gpu->llc_slice); >>>>>>> llcc_slice_putd(a6xx_gpu->htw_llc_slice); >>>>>>> } >>>>>>> @@ -1876,8 +1872,7 @@ static void a6xx_llc_slices_init(struct platform_device *pdev, >>>>>>> { >>>>>>> struct device_node *phandle; >>>>>>> >>>>>>> - /* No LLCC on non-RPMh (and by extension, non-GMU) SoCs */ >>>>>>> - if (adreno_has_gmu_wrapper(&a6xx_gpu->base)) >>>>>>> + if (a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE) >>>>>>> return; >>>>>> >>>>>> I think A612 is the "quirky" one here.. it has some sort of a GMU, >>>>>> but we're choosing not to implement it. maybe a check for >>>>>> >>>>>> if (adreno_has_gmu_wrapper && !adreno_is_a612) >>>>>> >>>>>> would be clearer here, with a comment that RGMU support is not >>>>>> implemented >>>>>> >>>>>> >>>>>> >>>>>> But going further, I'm a bit concerned about dt-bindings.. If we >>>>>> implement RGMU on the driver side in the future, that will require >>>>>> DT changes which will make the currently proposed description invalid. >>>>>> >>>>>> I think a better angle would be to add a adreno_has_rgmu() func with >>>>>> a qcom,adreno-rgmu compatible and plumb it correctly from the get-go. >>>>>> >>>>>> This way, we can avoid this syscache quirk as well. >>>>>> >>>>> >>>>> I am aware of at least Adreno 710 which doesn't have syscache, but has >>>>> proper GMU. And I don't see any reason why there couldn't be another one >>>>> in future to save silicon area. So, a quirk flag doesn't seem so bad in >>>>> this case. >>>>> >>>>> The correct way to avoid this quirk flag is by making LLCC driver return >>>>> a proper error to detect the absence of syscache. Currently, it just >>>>> returns EPROBE_DEFER which put driver in an infinite probe loop. >>>> >>>> Hmm, this seems solvable? llcc has a node in the dt, so it seems like >>>> it should be able to tell the difference between not existing and not >>>> being probed yet. Something maybe like, initialize drv_data to NULL >>>> instead of -EPROBE_DEFER, and then in the various entry points, if >>>> (!drv_data) return not_probed_helper(); which would check if a >>>> compatible node exists in dt? >>> >>> Sounds like that would work. Can we explore that separately? >>> >>> I am a bit worried about adding another subsystem's patch to this >>> series. That might delay this series by weeks. >> >> I don't think there is a dependency between the two, so it shouldn't >> delay anything. We can just merge the first patch in this series as >> it is and drop the second. And the llcc change is a legit bug fix, >> IMO, -EPROBE_DEFER is the incorrect return value when the device is >> not present. > > Actually, that wasn't _quite_ correct, but the idea still stands. > Re-send second patch, but without the ADRENO_QUIRK_NO_SYSCACHE parts, > and drop the first. > > In parallel send the llcc fix. There is no compile time dependency, > so they can go thru different trees. > Ack, will send separate patches. -Akhil. > BR, > -R > >> >> BR, >> -R >> >>> -Akhil >>> >>>> >>>> BR, >>>> -R >>>> >>>>> Agree about the dt binding suggestion. I will define a new compatible >>>>> string for rgmu. >>>>> >>>>> -Akhil. >>>>> >>>>>> Konrad >>>>> >>> ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 2/2] drm/msm/a6xx: Add support for Adreno 612 2024-11-25 16:32 [PATCH v2 0/2] Support for Adreno 612 GPU Akhil P Oommen 2024-11-25 16:33 ` [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE Akhil P Oommen @ 2024-11-25 16:33 ` Akhil P Oommen 1 sibling, 0 replies; 11+ messages in thread From: Akhil P Oommen @ 2024-11-25 16:33 UTC (permalink / raw) To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar, Dmitry Baryshkov, Marijn Suijten, David Airlie, Simona Vetter Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Jie Zhang, Akhil P Oommen, Konrad Dybcio From: Jie Zhang <quic_jiezh@quicinc.com> Add support for Adreno 612 GPU found in SM6150/QCS615 chipsets. A612 falls under ADRENO_6XX_GEN1 family and is a cut down version of A615 GPU. A612 has a new IP called Reduced Graphics Management Unit or RGMU which is a small state machine which helps to toggle GX GDSC (connected to CX rail) to implement IFPC feature. It doesn't support any other features of a full fledged GMU like clock control, resource voting to rpmh etc. So we need linux clock driver support like other gmu-wrapper implementations to control gpu core clock and gpu GX gdsc. Since there is no benefit with enabling RGMU at the moment, RGMU is entirely skipped in this patch. Signed-off-by: Jie Zhang <quic_jiezh@quicinc.com> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> --- drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 15 +++++++++++++ drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 35 ++++++++++++++++++++++++------- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 11 +++++++--- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c index 5e389f6b8b8a..633a966a0c39 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c @@ -705,6 +705,21 @@ static const struct adreno_info a6xx_gpus[] = { { 157, 3 }, { 127, 4 }, ), + }, { + .chip_ids = ADRENO_CHIP_IDS(0x06010200), + .family = ADRENO_6XX_GEN1, + .fw = { + [ADRENO_FW_SQE] = "a630_sqe.fw", + }, + .gmem = (SZ_128K + SZ_4K), + .inactive_period = DRM_MSM_INACTIVE_PERIOD, + .init = a6xx_gpu_init, + .a6xx = &(const struct a6xx_info) { + .hwcg = a612_hwcg, + .protect = &a630_protect, + .gmu_cgc_mode = 0x00000022, + .prim_fifo_threshold = 0x00080000, + }, }, { .chip_ids = ADRENO_CHIP_IDS(0x06010500), .family = ADRENO_6XX_GEN1, diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index a8b928d0f320..1af7bbed457a 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -504,15 +504,26 @@ static void a6xx_set_hwcg(struct msm_gpu *gpu, bool state) if (adreno_is_a630(adreno_gpu)) clock_cntl_on = 0x8aa8aa02; - else if (adreno_is_a610(adreno_gpu)) + else if (adreno_is_a610(adreno_gpu) || adreno_is_a612(adreno_gpu)) clock_cntl_on = 0xaaa8aa82; else if (adreno_is_a702(adreno_gpu)) clock_cntl_on = 0xaaaaaa82; else clock_cntl_on = 0x8aa8aa82; - cgc_delay = adreno_is_a615_family(adreno_gpu) ? 0x111 : 0x10111; - cgc_hyst = adreno_is_a615_family(adreno_gpu) ? 0x555 : 0x5555; + if (adreno_is_a612(adreno_gpu)) + cgc_delay = 0x11; + else if (adreno_is_a615_family(adreno_gpu)) + cgc_delay = 0x111; + else + cgc_delay = 0x10111; + + if (adreno_is_a612(adreno_gpu)) + cgc_hyst = 0x55; + else if (adreno_is_a615_family(adreno_gpu)) + cgc_delay = 0x555; + else + cgc_delay = 0x5555; gmu_write(&a6xx_gpu->gmu, REG_A6XX_GPU_GMU_AO_GMU_CGC_MODE_CNTL, state ? adreno_gpu->info->a6xx->gmu_cgc_mode : 0); @@ -600,6 +611,9 @@ static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu) gpu->ubwc_config.ubwc_swizzle = 0x7; } + if (adreno_is_a612(gpu)) + gpu->ubwc_config.highest_bank_bit = 13; + if (adreno_is_a618(gpu)) gpu->ubwc_config.highest_bank_bit = 14; @@ -1165,7 +1179,7 @@ static int hw_init(struct msm_gpu *gpu) gpu_write(gpu, REG_A6XX_CP_LPAC_PROG_FIFO_SIZE, 0x00000020); /* Setting the mem pool size */ - if (adreno_is_a610(adreno_gpu)) { + if (adreno_is_a610(adreno_gpu) || adreno_is_a612(adreno_gpu)) { gpu_write(gpu, REG_A6XX_CP_MEM_POOL_SIZE, 48); gpu_write(gpu, REG_A6XX_CP_MEM_POOL_DBG_ADDR, 47); } else if (adreno_is_a702(adreno_gpu)) { @@ -1199,7 +1213,7 @@ static int hw_init(struct msm_gpu *gpu) /* Enable fault detection */ if (adreno_is_a730(adreno_gpu) || - adreno_is_a740_family(adreno_gpu)) + adreno_is_a740_family(adreno_gpu) || adreno_is_a612(adreno_gpu)) gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0xcfffff); else if (adreno_is_a690(adreno_gpu)) gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0x4fffff); @@ -2076,6 +2090,9 @@ static int a6xx_pm_resume(struct msm_gpu *gpu) if (!ret) msm_devfreq_resume(gpu); + if (!(a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)) + a6xx_llc_activate(a6xx_gpu); + return ret; } @@ -2115,6 +2132,9 @@ static int a6xx_pm_suspend(struct msm_gpu *gpu) trace_msm_gpu_suspend(0); + if (!(a6xx_gpu->base.info->quirks & ADRENO_QUIRK_NO_SYSCACHE)) + a6xx_llc_deactivate(a6xx_gpu); + msm_devfreq_suspend(gpu); mutex_lock(&a6xx_gpu->gmu.lock); @@ -2480,11 +2500,8 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) config->info->family == ADRENO_7XX_GEN2 || config->info->family == ADRENO_7XX_GEN3; - a6xx_llc_slices_init(pdev, a6xx_gpu, is_a7xx); - ret = a6xx_set_supported_hw(&pdev->dev, config->info); if (ret) { - a6xx_llc_slices_destroy(a6xx_gpu); kfree(a6xx_gpu); return ERR_PTR(ret); } @@ -2503,6 +2520,8 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) return ERR_PTR(ret); } + a6xx_llc_slices_init(pdev, a6xx_gpu, is_a7xx); + /* * For now only clamp to idle freq for devices where this is known not * to cause power supply issues: diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h index 398be2218110..a6462a255611 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -421,6 +421,11 @@ static inline int adreno_is_a610(const struct adreno_gpu *gpu) return adreno_is_revn(gpu, 610); } +static inline int adreno_is_a612(const struct adreno_gpu *gpu) +{ + return gpu->info->chip_ids[0] == 0x06010200; +} + static inline int adreno_is_a618(const struct adreno_gpu *gpu) { return adreno_is_revn(gpu, 618); @@ -490,9 +495,9 @@ static inline int adreno_is_a610_family(const struct adreno_gpu *gpu) { if (WARN_ON_ONCE(!gpu->info)) return false; - - /* TODO: A612 */ - return adreno_is_a610(gpu) || adreno_is_a702(gpu); + return adreno_is_a610(gpu) || + adreno_is_a612(gpu) || + adreno_is_a702(gpu); } /* TODO: 615/616 */ -- 2.45.2 ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-12-05 15:36 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-11-25 16:32 [PATCH v2 0/2] Support for Adreno 612 GPU Akhil P Oommen 2024-11-25 16:33 ` [PATCH v2 1/2] drm/msm/adreno: Introduce ADRENO_QUIRK_NO_SYSCACHE Akhil P Oommen 2024-11-25 16:46 ` Dmitry Baryshkov 2024-11-30 13:31 ` Konrad Dybcio 2024-11-30 20:30 ` Akhil P Oommen 2024-12-01 16:36 ` Rob Clark 2024-12-04 19:03 ` Akhil P Oommen 2024-12-04 21:47 ` Rob Clark 2024-12-04 21:50 ` Rob Clark 2024-12-05 15:36 ` Akhil P Oommen 2024-11-25 16:33 ` [PATCH v2 2/2] drm/msm/a6xx: Add support for Adreno 612 Akhil P Oommen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®