mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 22:14:36 -04:00
drm/msm/dpu: rip out master planes support
Master/virtual planes were used for multirect support. In preparation to reworking DPU planes, drop support for master planes (which was not used anyway). Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/473146/ Link: https://lore.kernel.org/r/20220209172520.3719906-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
committed by
Rob Clark
parent
4bca876458
commit
aabf9220df
@@ -1235,17 +1235,8 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
|
||||
}
|
||||
|
||||
for (i = 1; i < SSPP_MAX; i++) {
|
||||
if (pipe_staged[i]) {
|
||||
if (pipe_staged[i])
|
||||
dpu_plane_clear_multirect(pipe_staged[i]);
|
||||
|
||||
if (is_dpu_plane_virtual(pipe_staged[i]->plane)) {
|
||||
DPU_ERROR(
|
||||
"r1 only virt plane:%d not supported\n",
|
||||
pipe_staged[i]->plane->base.id);
|
||||
rc = -EINVAL;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
z_pos = -1;
|
||||
|
||||
@@ -780,8 +780,7 @@ static const struct dpu_sspp_cfg *_sspp_offset(enum dpu_sspp sspp,
|
||||
}
|
||||
|
||||
struct dpu_hw_pipe *dpu_hw_sspp_init(enum dpu_sspp idx,
|
||||
void __iomem *addr, const struct dpu_mdss_cfg *catalog,
|
||||
bool is_virtual_pipe)
|
||||
void __iomem *addr, const struct dpu_mdss_cfg *catalog)
|
||||
{
|
||||
struct dpu_hw_pipe *hw_pipe;
|
||||
const struct dpu_sspp_cfg *cfg;
|
||||
|
||||
@@ -377,11 +377,9 @@ struct dpu_kms;
|
||||
* @idx: Pipe index for which driver object is required
|
||||
* @addr: Mapped register io address of MDP
|
||||
* @catalog : Pointer to mdss catalog data
|
||||
* @is_virtual_pipe: is this pipe virtual pipe
|
||||
*/
|
||||
struct dpu_hw_pipe *dpu_hw_sspp_init(enum dpu_sspp idx,
|
||||
void __iomem *addr, const struct dpu_mdss_cfg *catalog,
|
||||
bool is_virtual_pipe);
|
||||
void __iomem *addr, const struct dpu_mdss_cfg *catalog);
|
||||
|
||||
/**
|
||||
* dpu_hw_sspp_destroy(): Destroys SSPP driver context
|
||||
|
||||
@@ -779,7 +779,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
|
||||
catalog->sspp[i].features & BIT(DPU_SSPP_CURSOR));
|
||||
|
||||
plane = dpu_plane_init(dev, catalog->sspp[i].id, type,
|
||||
(1UL << max_crtc_count) - 1, 0);
|
||||
(1UL << max_crtc_count) - 1);
|
||||
if (IS_ERR(plane)) {
|
||||
DPU_ERROR("dpu_plane_init failed\n");
|
||||
ret = PTR_ERR(plane);
|
||||
|
||||
@@ -91,7 +91,7 @@ enum dpu_plane_qos {
|
||||
/*
|
||||
* struct dpu_plane - local dpu plane structure
|
||||
* @aspace: address space pointer
|
||||
* @mplane_list: List of multirect planes of the same pipe
|
||||
* @csc_ptr: Points to dpu_csc_cfg structure to use for current
|
||||
* @catalog: Points to dpu catalog structure
|
||||
* @revalidate: force revalidation of all the plane properties
|
||||
*/
|
||||
@@ -106,8 +106,6 @@ struct dpu_plane {
|
||||
uint32_t color_fill;
|
||||
bool is_error;
|
||||
bool is_rt_pipe;
|
||||
bool is_virtual;
|
||||
struct list_head mplane_list;
|
||||
const struct dpu_mdss_cfg *catalog;
|
||||
};
|
||||
|
||||
@@ -225,7 +223,7 @@ static void _dpu_plane_calc_clk(struct drm_plane *plane, struct dpu_hw_pipe_cfg
|
||||
static int _dpu_plane_calc_fill_level(struct drm_plane *plane,
|
||||
const struct dpu_format *fmt, u32 src_width)
|
||||
{
|
||||
struct dpu_plane *pdpu, *tmp;
|
||||
struct dpu_plane *pdpu;
|
||||
struct dpu_plane_state *pstate;
|
||||
u32 fixed_buff_size;
|
||||
u32 total_fl;
|
||||
@@ -239,19 +237,7 @@ static int _dpu_plane_calc_fill_level(struct drm_plane *plane,
|
||||
pstate = to_dpu_plane_state(plane->state);
|
||||
fixed_buff_size = pdpu->catalog->caps->pixel_ram_size;
|
||||
|
||||
list_for_each_entry(tmp, &pdpu->mplane_list, mplane_list) {
|
||||
u32 tmp_width;
|
||||
|
||||
if (!tmp->base.state->visible)
|
||||
continue;
|
||||
tmp_width = drm_rect_width(&tmp->base.state->src) >> 16;
|
||||
DPU_DEBUG("plane%d/%d src_width:%d/%d\n",
|
||||
pdpu->base.base.id, tmp->base.base.id,
|
||||
src_width,
|
||||
tmp_width);
|
||||
src_width = max_t(u32, src_width,
|
||||
tmp_width);
|
||||
}
|
||||
/* FIXME: in multirect case account for the src_width of all the planes */
|
||||
|
||||
if (fmt->fetch_planes == DPU_PLANE_PSEUDO_PLANAR) {
|
||||
if (fmt->chroma_sample == DPU_CHROMA_420) {
|
||||
@@ -854,13 +840,8 @@ int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane)
|
||||
}
|
||||
|
||||
done:
|
||||
if (dpu_plane[R0]->is_virtual) {
|
||||
pstate[R0]->multirect_index = DPU_SSPP_RECT_1;
|
||||
pstate[R1]->multirect_index = DPU_SSPP_RECT_0;
|
||||
} else {
|
||||
pstate[R0]->multirect_index = DPU_SSPP_RECT_0;
|
||||
pstate[R1]->multirect_index = DPU_SSPP_RECT_1;
|
||||
}
|
||||
pstate[R0]->multirect_index = DPU_SSPP_RECT_0;
|
||||
pstate[R1]->multirect_index = DPU_SSPP_RECT_1;
|
||||
|
||||
DPU_DEBUG_PLANE(dpu_plane[R0], "R0: %d - %d\n",
|
||||
pstate[R0]->multirect_mode, pstate[R0]->multirect_index);
|
||||
@@ -1266,19 +1247,13 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
|
||||
|
||||
static void _dpu_plane_atomic_disable(struct drm_plane *plane)
|
||||
{
|
||||
struct dpu_plane *pdpu = to_dpu_plane(plane);
|
||||
struct drm_plane_state *state = plane->state;
|
||||
struct dpu_plane_state *pstate = to_dpu_plane_state(state);
|
||||
|
||||
trace_dpu_plane_disable(DRMID(plane), is_dpu_plane_virtual(plane),
|
||||
trace_dpu_plane_disable(DRMID(plane), false,
|
||||
pstate->multirect_mode);
|
||||
|
||||
pstate->pending = true;
|
||||
|
||||
if (is_dpu_plane_virtual(plane) &&
|
||||
pdpu->pipe_hw && pdpu->pipe_hw->ops.setup_multirect)
|
||||
pdpu->pipe_hw->ops.setup_multirect(pdpu->pipe_hw,
|
||||
DPU_SSPP_RECT_SOLO, DPU_SSPP_MULTIRECT_NONE);
|
||||
}
|
||||
|
||||
static void dpu_plane_atomic_update(struct drm_plane *plane,
|
||||
@@ -1493,17 +1468,12 @@ enum dpu_sspp dpu_plane_pipe(struct drm_plane *plane)
|
||||
return plane ? to_dpu_plane(plane)->pipe : SSPP_NONE;
|
||||
}
|
||||
|
||||
bool is_dpu_plane_virtual(struct drm_plane *plane)
|
||||
{
|
||||
return plane ? to_dpu_plane(plane)->is_virtual : false;
|
||||
}
|
||||
|
||||
/* initialize plane */
|
||||
struct drm_plane *dpu_plane_init(struct drm_device *dev,
|
||||
uint32_t pipe, enum drm_plane_type type,
|
||||
unsigned long possible_crtcs, u32 master_plane_id)
|
||||
unsigned long possible_crtcs)
|
||||
{
|
||||
struct drm_plane *plane = NULL, *master_plane = NULL;
|
||||
struct drm_plane *plane = NULL;
|
||||
const uint32_t *format_list;
|
||||
struct dpu_plane *pdpu;
|
||||
struct msm_drm_private *priv = dev->dev_private;
|
||||
@@ -1524,18 +1494,9 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
|
||||
/* cache local stuff for later */
|
||||
plane = &pdpu->base;
|
||||
pdpu->pipe = pipe;
|
||||
pdpu->is_virtual = (master_plane_id != 0);
|
||||
INIT_LIST_HEAD(&pdpu->mplane_list);
|
||||
master_plane = drm_plane_find(dev, NULL, master_plane_id);
|
||||
if (master_plane) {
|
||||
struct dpu_plane *mpdpu = to_dpu_plane(master_plane);
|
||||
|
||||
list_add_tail(&pdpu->mplane_list, &mpdpu->mplane_list);
|
||||
}
|
||||
|
||||
/* initialize underlying h/w driver */
|
||||
pdpu->pipe_hw = dpu_hw_sspp_init(pipe, kms->mmio, kms->catalog,
|
||||
master_plane_id != 0);
|
||||
pdpu->pipe_hw = dpu_hw_sspp_init(pipe, kms->mmio, kms->catalog);
|
||||
if (IS_ERR(pdpu->pipe_hw)) {
|
||||
DPU_ERROR("[%u]SSPP init failed\n", pipe);
|
||||
ret = PTR_ERR(pdpu->pipe_hw);
|
||||
@@ -1545,14 +1506,8 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
|
||||
goto clean_sspp;
|
||||
}
|
||||
|
||||
if (pdpu->is_virtual) {
|
||||
format_list = pdpu->pipe_hw->cap->sblk->virt_format_list;
|
||||
num_formats = pdpu->pipe_hw->cap->sblk->virt_num_formats;
|
||||
}
|
||||
else {
|
||||
format_list = pdpu->pipe_hw->cap->sblk->format_list;
|
||||
num_formats = pdpu->pipe_hw->cap->sblk->num_formats;
|
||||
}
|
||||
format_list = pdpu->pipe_hw->cap->sblk->format_list;
|
||||
num_formats = pdpu->pipe_hw->cap->sblk->num_formats;
|
||||
|
||||
ret = drm_universal_plane_init(dev, plane, 0xff, &dpu_plane_funcs,
|
||||
format_list, num_formats,
|
||||
@@ -1594,15 +1549,14 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
|
||||
|
||||
mutex_init(&pdpu->lock);
|
||||
|
||||
DPU_DEBUG("%s created for pipe:%u id:%u virtual:%u\n", plane->name,
|
||||
pipe, plane->base.id, master_plane_id);
|
||||
DPU_DEBUG("%s created for pipe:%u id:%u\n", plane->name,
|
||||
pipe, plane->base.id);
|
||||
return plane;
|
||||
|
||||
clean_sspp:
|
||||
if (pdpu && pdpu->pipe_hw)
|
||||
dpu_hw_sspp_destroy(pdpu->pipe_hw);
|
||||
clean_plane:
|
||||
list_del(&pdpu->mplane_list);
|
||||
kfree(pdpu);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
@@ -64,14 +64,6 @@ struct dpu_multirect_plane_states {
|
||||
*/
|
||||
enum dpu_sspp dpu_plane_pipe(struct drm_plane *plane);
|
||||
|
||||
/**
|
||||
* is_dpu_plane_virtual - check for virtual plane
|
||||
* @plane: Pointer to DRM plane object
|
||||
* returns: true - if the plane is virtual
|
||||
* false - if the plane is primary
|
||||
*/
|
||||
bool is_dpu_plane_virtual(struct drm_plane *plane);
|
||||
|
||||
/**
|
||||
* dpu_plane_get_ctl_flush - get control flush mask
|
||||
* @plane: Pointer to DRM plane object
|
||||
@@ -99,14 +91,11 @@ void dpu_plane_set_error(struct drm_plane *plane, bool error);
|
||||
* @pipe: dpu hardware pipe identifier
|
||||
* @type: Plane type - PRIMARY/OVERLAY/CURSOR
|
||||
* @possible_crtcs: bitmask of crtc that can be attached to the given pipe
|
||||
* @master_plane_id: primary plane id of a multirect pipe. 0 value passed for
|
||||
* a regular plane initialization. A non-zero primary plane
|
||||
* id will be passed for a virtual pipe initialization.
|
||||
*
|
||||
*/
|
||||
struct drm_plane *dpu_plane_init(struct drm_device *dev,
|
||||
uint32_t pipe, enum drm_plane_type type,
|
||||
unsigned long possible_crtcs, u32 master_plane_id);
|
||||
unsigned long possible_crtcs);
|
||||
|
||||
/**
|
||||
* dpu_plane_validate_multirecti_v2 - validate the multirect planes
|
||||
|
||||
Reference in New Issue
Block a user