drm/msm: rearrange the gpu_rmw() function
The register read-modify-write construct is generic enough that it can be used by other subsystems as needed, create a more generic rmw() function and have the gpu_rmw() use this new function. Signed-off-by: Sharat Masetty <smasetty@codeaurora.org> Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org> Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
Родитель
9e0673c00c
Коммит
40a72b0c7f
|
@ -181,6 +181,14 @@ u32 msm_readl(const void __iomem *addr)
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void msm_rmw(void __iomem *addr, u32 mask, u32 or)
|
||||||
|
{
|
||||||
|
u32 val = msm_readl(addr);
|
||||||
|
|
||||||
|
val &= ~mask;
|
||||||
|
msm_writel(val | or, addr);
|
||||||
|
}
|
||||||
|
|
||||||
struct msm_vblank_work {
|
struct msm_vblank_work {
|
||||||
struct work_struct work;
|
struct work_struct work;
|
||||||
int crtc_id;
|
int crtc_id;
|
||||||
|
|
|
@ -437,6 +437,7 @@ void __iomem *msm_ioremap_quiet(struct platform_device *pdev, const char *name,
|
||||||
const char *dbgname);
|
const char *dbgname);
|
||||||
void msm_writel(u32 data, void __iomem *addr);
|
void msm_writel(u32 data, void __iomem *addr);
|
||||||
u32 msm_readl(const void __iomem *addr);
|
u32 msm_readl(const void __iomem *addr);
|
||||||
|
void msm_rmw(void __iomem *addr, u32 mask, u32 or);
|
||||||
|
|
||||||
struct msm_gpu_submitqueue;
|
struct msm_gpu_submitqueue;
|
||||||
int msm_submitqueue_init(struct drm_device *drm, struct msm_file_private *ctx);
|
int msm_submitqueue_init(struct drm_device *drm, struct msm_file_private *ctx);
|
||||||
|
|
|
@ -256,10 +256,7 @@ static inline u32 gpu_read(struct msm_gpu *gpu, u32 reg)
|
||||||
|
|
||||||
static inline void gpu_rmw(struct msm_gpu *gpu, u32 reg, u32 mask, u32 or)
|
static inline void gpu_rmw(struct msm_gpu *gpu, u32 reg, u32 mask, u32 or)
|
||||||
{
|
{
|
||||||
uint32_t val = gpu_read(gpu, reg);
|
msm_rmw(gpu->mmio + (reg << 2), mask, or);
|
||||||
|
|
||||||
val &= ~mask;
|
|
||||||
gpu_write(gpu, reg, val | or);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u64 gpu_read64(struct msm_gpu *gpu, u32 lo, u32 hi)
|
static inline u64 gpu_read64(struct msm_gpu *gpu, u32 lo, u32 hi)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче