Commit f9b96be0 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Sean Paul

drm/rockchip: Use drm_plane_helper_check_state()

Replace the use of drm_plane_helper_check_update() with
drm_plane_helper_check_state() since we have a plane state.

Rockchip looks to handling plane clipping rather well already
(unlikje most arm drm drivers) so there are no function changes
here.

Cc: Yao <mark.yao@rock-chips.com>
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: default avatarMark Yao <mark.yao@rock-chips.com>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1469549224-1860-8-git-send-email-ville.syrjala@linux.intel.com
parent ac92028e
...@@ -591,10 +591,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, ...@@ -591,10 +591,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
struct vop_win *vop_win = to_vop_win(plane); struct vop_win *vop_win = to_vop_win(plane);
struct vop_plane_state *vop_plane_state = to_vop_plane_state(state); struct vop_plane_state *vop_plane_state = to_vop_plane_state(state);
const struct vop_win_data *win = vop_win->data; const struct vop_win_data *win = vop_win->data;
bool visible;
int ret; int ret;
struct drm_rect *dest = &state->dst;
struct drm_rect *src = &state->src;
struct drm_rect clip; struct drm_rect clip;
int min_scale = win->phy->scl ? FRAC_16_16(1, 8) : int min_scale = win->phy->scl ? FRAC_16_16(1, 8) :
DRM_PLANE_HELPER_NO_SCALING; DRM_PLANE_HELPER_NO_SCALING;
...@@ -608,30 +605,18 @@ static int vop_plane_atomic_check(struct drm_plane *plane, ...@@ -608,30 +605,18 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
if (WARN_ON(!crtc_state)) if (WARN_ON(!crtc_state))
return -EINVAL; return -EINVAL;
src->x1 = state->src_x;
src->y1 = state->src_y;
src->x2 = state->src_x + state->src_w;
src->y2 = state->src_y + state->src_h;
dest->x1 = state->crtc_x;
dest->y1 = state->crtc_y;
dest->x2 = state->crtc_x + state->crtc_w;
dest->y2 = state->crtc_y + state->crtc_h;
clip.x1 = 0; clip.x1 = 0;
clip.y1 = 0; clip.y1 = 0;
clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.x2 = crtc_state->adjusted_mode.hdisplay;
clip.y2 = crtc_state->adjusted_mode.vdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay;
ret = drm_plane_helper_check_update(plane, crtc, state->fb, ret = drm_plane_helper_check_state(state, &clip,
src, dest, &clip, min_scale, max_scale,
state->rotation, true, true);
min_scale,
max_scale,
true, true, &visible);
if (ret) if (ret)
return ret; return ret;
if (!visible) if (!state->visible)
goto out_disable; goto out_disable;
vop_plane_state->format = vop_convert_format(fb->pixel_format); vop_plane_state->format = vop_convert_format(fb->pixel_format);
...@@ -642,7 +627,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, ...@@ -642,7 +627,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
* Src.x1 can be odd when do clip, but yuv plane start point * Src.x1 can be odd when do clip, but yuv plane start point
* need align with 2 pixel. * need align with 2 pixel.
*/ */
if (is_yuv_support(fb->pixel_format) && ((src->x1 >> 16) % 2)) if (is_yuv_support(fb->pixel_format) && ((state->src.x1 >> 16) % 2))
return -EINVAL; return -EINVAL;
vop_plane_state->enable = true; vop_plane_state->enable = true;
......
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