Skip to content

Commit

Permalink
drm/msm: Set adreno_smmu as gpu's drvdata
Browse files Browse the repository at this point in the history
This will be populated by adreno-smmu, to provide a way for coordinating
enabling/disabling TTBR0 translation.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
  • Loading branch information
Rob Clark committed Sep 12, 2020
1 parent 69a9313 commit 9cba405
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions drivers/gpu/drm/msm/adreno/adreno_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@ static int adreno_bind(struct device *dev, struct device *master, void *data)
return PTR_ERR(gpu);
}

dev_set_drvdata(dev, gpu);

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/msm_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
gpu->gpu_cx = NULL;

gpu->pdev = pdev;
platform_set_drvdata(pdev, gpu);
platform_set_drvdata(pdev, &gpu->adreno_smmu);

msm_devfreq_init(gpu);

Expand Down
6 changes: 5 additions & 1 deletion drivers/gpu/drm/msm/msm_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifndef __MSM_GPU_H__
#define __MSM_GPU_H__

#include <linux/adreno-smmu-priv.h>
#include <linux/clk.h>
#include <linux/interconnect.h>
#include <linux/pm_opp.h>
Expand Down Expand Up @@ -74,6 +75,8 @@ struct msm_gpu {
struct platform_device *pdev;
const struct msm_gpu_funcs *funcs;

struct adreno_smmu_priv adreno_smmu;

/* performance counters (hw & sw): */
spinlock_t perf_lock;
bool perfcntr_active;
Expand Down Expand Up @@ -146,7 +149,8 @@ struct msm_gpu {

static inline struct msm_gpu *dev_to_gpu(struct device *dev)
{
return dev_get_drvdata(dev);
struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(dev);
return container_of(adreno_smmu, struct msm_gpu, adreno_smmu);
}

/* It turns out that all targets use the same ringbuffer size */
Expand Down

0 comments on commit 9cba405

Please sign in to comment.