mirror of https://gitee.com/openkylin/linux.git
drm/armada: Use drm_mode_get_hv_timing() to populate plane clip rectangle
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Since armada isn't atomic we'll use crtc->enabled and crtc->mode instead of the stuff under crtc_state. Once everyone agrees on how the clip rectangle gets set up we can move the code into drm_atomic_helper_check_plane_state(). Cc: Dave Airlie <airlied@redhat.com> Cc: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180123170857.13818-4-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
57270b8191
commit
bf817d0cf7
|
@ -1204,12 +1204,13 @@ static int armada_drm_primary_update(struct drm_plane *plane,
|
||||||
.crtc = crtc,
|
.crtc = crtc,
|
||||||
.enable = crtc->enabled,
|
.enable = crtc->enabled,
|
||||||
};
|
};
|
||||||
const struct drm_rect clip = {
|
struct drm_rect clip = {};
|
||||||
.x2 = crtc->mode.hdisplay,
|
|
||||||
.y2 = crtc->mode.vdisplay,
|
|
||||||
};
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (crtc->enabled)
|
||||||
|
drm_mode_get_hv_timing(&crtc->mode,
|
||||||
|
&clip.x2, &clip.y2);
|
||||||
|
|
||||||
ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, &clip, 0,
|
ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, &clip, 0,
|
||||||
INT_MAX, true, false);
|
INT_MAX, true, false);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -209,16 +209,17 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
|
||||||
.crtc = crtc,
|
.crtc = crtc,
|
||||||
.enable = crtc->enabled,
|
.enable = crtc->enabled,
|
||||||
};
|
};
|
||||||
const struct drm_rect clip = {
|
struct drm_rect clip = {};
|
||||||
.x2 = crtc->mode.hdisplay,
|
|
||||||
.y2 = crtc->mode.vdisplay,
|
|
||||||
};
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
trace_armada_ovl_plane_update(plane, crtc, fb,
|
trace_armada_ovl_plane_update(plane, crtc, fb,
|
||||||
crtc_x, crtc_y, crtc_w, crtc_h,
|
crtc_x, crtc_y, crtc_w, crtc_h,
|
||||||
src_x, src_y, src_w, src_h);
|
src_x, src_y, src_w, src_h);
|
||||||
|
|
||||||
|
if (crtc->enabled)
|
||||||
|
drm_mode_get_hv_timing(&crtc->mode,
|
||||||
|
&clip.x2, &clip.y2);
|
||||||
|
|
||||||
ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, &clip, 0,
|
ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, &clip, 0,
|
||||||
INT_MAX, true, false);
|
INT_MAX, true, false);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
Loading…
Reference in New Issue