drm/nouveau: Make clock gate support conditional
Subsystems (3)
PATCH 1/1 drm/nouveau: Make clock gate support conditional
From: Thierry Reding <[email protected]>
The recently introduced clock gate support breaks on Tegra chips because no thermal support is enabled for those devices. Conditionalize the code on the existence of thermal support to fix this.
Fixes b138eca661cc ("drm/nouveau: Add support for basic clockgating on Kepler1")
Cc Martin Peres <[email protected]>
Cc Lyude Paul <[email protected]>
Signed-off-by Thierry Reding <[email protected]>
--- drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +3 -3
@@ -301,7 +301,7 @@ nvkm_therm_attr_set(struct nvkm_therm *therm,void nvkm_therm_clkgate_enable (struct nvkm_therm *therm) { -if (!therm->func->clkgate_enable || !therm->clkgating_enabled) +if (!therm || !therm->func->clkgate_enable || !therm->clkgating_enabled)return ; nvkm_debug(&therm->subdev,
@@ -312,7 +312,7 @@ nvkm_therm_clkgate_enable(struct nvkm_therm *therm)void nvkm_therm_clkgate_fini (struct nvkm_therm *therm,bool suspend) { -if (!therm->func->clkgate_fini || !therm->clkgating_enabled) +if (!therm || !therm->func->clkgate_fini || !therm->clkgating_enabled)return ; nvkm_debug(&therm->subdev,
@@ -395,7 +395,7 @@ void nvkm_therm_clkgate_init(struct nvkm_therm *therm, const struct nvkm_therm_clkgate_pack *p) { -if (!therm->func->clkgate_init || !therm->clkgating_enabled) +if (!therm || !therm->func->clkgate_init || !therm->clkgating_enabled)return ; therm->func->clkgate_init (therm, p);
Signature · 6 lines
2.15.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by Lyude Paul <[email protected]>
Quoted 50 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The recently introduced clock gate support breaks on Tegra chips because no thermal support is enabled for those devices. Conditionalize the code on the existence of thermal support to fix this.
Fixes b138eca661cc ("drm/nouveau: Add support for basic clockgating onKepler1")
Cc Martin Peres <[email protected]>Cc Lyude Paul <[email protected]>Signed-off-by Thierry Reding <[email protected]>--- drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +1
-1@@ -301,7 +301,7 @@ nvkm_therm_attr_set(struct nvkm_therm *therm,void nvkm_therm_clkgate_enable (struct nvkm_therm *therm) { -if (!therm->func->clkgate_enable || !therm->clkgating_enabled) +if (!therm || !therm->func->clkgate_enable || !therm- >clkgating_enabled)return ;drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +1
-1nvkm_debug(&therm->subdev,@@ -312,7 +312,7 @@ nvkm_therm_clkgate_enable(struct nvkm_therm *therm)void nvkm_therm_clkgate_fini (struct nvkm_therm *therm,bool suspend) { -if (!therm->func->clkgate_fini || !therm->clkgating_enabled) +if (!therm || !therm->func->clkgate_fini || !therm- >clkgating_enabled)return ;drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +1
-1nvkm_debug(&therm->subdev,@@ -395,7 +395,7 @@ void nvkm_therm_clkgate_init(struct nvkm_therm *therm, const struct nvkm_therm_clkgate_pack *p) { -if (!therm->func->clkgate_init || !therm->clkgating_enabled) +if (!therm || !therm->func->clkgate_init || !therm- >clkgating_enabled)return ;
therm->func->clkgate_init(therm, p);
Signature · 6 lines
Cheers, Lyude Paul _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel