Commit 9ffd0e85 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Rob Clark

drm/msm/dpu: setup merge modes in merge_3d block

Handle setting up merge mode in merge_3d hardware block.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent c40e6c67
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#include "dpu_kms.h" #include "dpu_kms.h"
#include "dpu_trace.h" #include "dpu_trace.h"
#define MERGE_3D_MUX 0x000
#define MERGE_3D_MODE 0x004
static const struct dpu_merge_3d_cfg *_merge_3d_offset(enum dpu_merge_3d idx, static const struct dpu_merge_3d_cfg *_merge_3d_offset(enum dpu_merge_3d idx,
const struct dpu_mdss_cfg *m, const struct dpu_mdss_cfg *m,
void __iomem *addr, void __iomem *addr,
...@@ -32,9 +35,27 @@ static const struct dpu_merge_3d_cfg *_merge_3d_offset(enum dpu_merge_3d idx, ...@@ -32,9 +35,27 @@ static const struct dpu_merge_3d_cfg *_merge_3d_offset(enum dpu_merge_3d idx,
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
static void dpu_hw_merge_3d_setup_3d_mode(struct dpu_hw_merge_3d *merge_3d,
enum dpu_3d_blend_mode mode_3d)
{
struct dpu_hw_blk_reg_map *c;
u32 data;
c = &merge_3d->hw;
if (mode_3d == BLEND_3D_NONE) {
DPU_REG_WRITE(c, MERGE_3D_MODE, 0);
DPU_REG_WRITE(c, MERGE_3D_MUX, 0);
} else {
data = BIT(0) | ((mode_3d - 1) << 1);
DPU_REG_WRITE(c, MERGE_3D_MODE, data);
}
}
static void _setup_merge_3d_ops(struct dpu_hw_merge_3d *c, static void _setup_merge_3d_ops(struct dpu_hw_merge_3d *c,
unsigned long features) unsigned long features)
{ {
c->ops.setup_3d_mode = dpu_hw_merge_3d_setup_3d_mode;
}; };
static struct dpu_hw_blk_ops dpu_hw_ops; static struct dpu_hw_blk_ops dpu_hw_ops;
......
...@@ -16,8 +16,12 @@ struct dpu_hw_merge_3d; ...@@ -16,8 +16,12 @@ struct dpu_hw_merge_3d;
* *
* struct dpu_hw_merge_3d_ops : Interface to the merge_3d Hw driver functions * struct dpu_hw_merge_3d_ops : Interface to the merge_3d Hw driver functions
* Assumption is these functions will be called after clocks are enabled * Assumption is these functions will be called after clocks are enabled
* @setup_3d_mode : enable 3D merge
*/ */
struct dpu_hw_merge_3d_ops { struct dpu_hw_merge_3d_ops {
void (*setup_3d_mode)(struct dpu_hw_merge_3d *merge_3d,
enum dpu_3d_blend_mode mode_3d);
}; };
struct dpu_hw_merge_3d { struct dpu_hw_merge_3d {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment