Commit 2682cefe authored by Sean Paul's avatar Sean Paul Committed by Rob Clark

drm/msm: dpu: Make dpu_plane_sspp_atomic_update() void

All of the checks in dpu_plane_sspp_atomic_update() are impossible, so
remove them and make the function void. This removes the need to error
check in dpu_plane_atomic_update(). Additionally, remove impossible checks
in dpu_plane_atomic_update().

Changes in v2:
- None
Reviewed-by: default avatarJeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent e1ba78fc
...@@ -1194,45 +1194,17 @@ void dpu_plane_set_error(struct drm_plane *plane, bool error) ...@@ -1194,45 +1194,17 @@ void dpu_plane_set_error(struct drm_plane *plane, bool error)
pdpu->is_error = error; pdpu->is_error = error;
} }
static int dpu_plane_sspp_atomic_update(struct drm_plane *plane, static void dpu_plane_sspp_atomic_update(struct drm_plane *plane,
struct drm_plane_state *old_state) struct drm_plane_state *old_state)
{ {
uint32_t nplanes, src_flags; uint32_t src_flags;
struct dpu_plane *pdpu; struct dpu_plane *pdpu = to_dpu_plane(plane);
struct drm_plane_state *state; struct drm_plane_state *state = plane->state;
struct dpu_plane_state *pstate; struct dpu_plane_state *pstate = to_dpu_plane_state(state);
struct dpu_plane_state *old_pstate; struct drm_crtc *crtc = state->crtc;
const struct dpu_format *fmt; struct drm_framebuffer *fb = state->fb;
struct drm_crtc *crtc; const struct dpu_format *fmt =
struct drm_framebuffer *fb; to_dpu_format(msm_framebuffer_format(fb));
if (!plane) {
DPU_ERROR("invalid plane\n");
return -EINVAL;
} else if (!plane->state) {
DPU_ERROR("invalid plane state\n");
return -EINVAL;
} else if (!old_state) {
DPU_ERROR("invalid old state\n");
return -EINVAL;
}
pdpu = to_dpu_plane(plane);
state = plane->state;
pstate = to_dpu_plane_state(state);
old_pstate = to_dpu_plane_state(old_state);
crtc = state->crtc;
fb = state->fb;
if (!crtc || !fb) {
DPU_ERROR_PLANE(pdpu, "invalid crtc %d or fb %d\n",
crtc != 0, fb != 0);
return -EINVAL;
}
fmt = to_dpu_format(msm_framebuffer_format(fb));
nplanes = fmt->num_planes;
memset(&(pdpu->pipe_cfg), 0, sizeof(struct dpu_hw_pipe_cfg)); memset(&(pdpu->pipe_cfg), 0, sizeof(struct dpu_hw_pipe_cfg));
...@@ -1263,7 +1235,7 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane *plane, ...@@ -1263,7 +1235,7 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane *plane,
/* override for color fill */ /* override for color fill */
if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG) { if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG) {
/* skip remaining processing on color fill */ /* skip remaining processing on color fill */
return 0; return;
} }
if (pdpu->pipe_hw->ops.setup_rects) { if (pdpu->pipe_hw->ops.setup_rects) {
...@@ -1334,7 +1306,6 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane *plane, ...@@ -1334,7 +1306,6 @@ static int dpu_plane_sspp_atomic_update(struct drm_plane *plane,
} }
_dpu_plane_set_qos_remap(plane); _dpu_plane_set_qos_remap(plane);
return 0;
} }
static void _dpu_plane_atomic_disable(struct drm_plane *plane, static void _dpu_plane_atomic_disable(struct drm_plane *plane,
...@@ -1373,31 +1344,17 @@ static void _dpu_plane_atomic_disable(struct drm_plane *plane, ...@@ -1373,31 +1344,17 @@ static void _dpu_plane_atomic_disable(struct drm_plane *plane,
static void dpu_plane_atomic_update(struct drm_plane *plane, static void dpu_plane_atomic_update(struct drm_plane *plane,
struct drm_plane_state *old_state) struct drm_plane_state *old_state)
{ {
struct dpu_plane *pdpu; struct dpu_plane *pdpu = to_dpu_plane(plane);
struct drm_plane_state *state; struct drm_plane_state *state = plane->state;
if (!plane) {
DPU_ERROR("invalid plane\n");
return;
} else if (!plane->state) {
DPU_ERROR("invalid plane state\n");
return;
}
pdpu = to_dpu_plane(plane);
pdpu->is_error = false; pdpu->is_error = false;
state = plane->state;
DPU_DEBUG_PLANE(pdpu, "\n"); DPU_DEBUG_PLANE(pdpu, "\n");
if (!state->visible) { if (!state->visible) {
_dpu_plane_atomic_disable(plane, old_state); _dpu_plane_atomic_disable(plane, old_state);
} else { } else {
int ret; dpu_plane_sspp_atomic_update(plane, old_state);
ret = dpu_plane_sspp_atomic_update(plane, old_state);
/* atomic_check should have ensured that this doesn't fail */
WARN_ON(ret < 0);
} }
} }
......
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