drm/i915: 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. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1469549224-1860-6-git-send-email-ville.syrjala@linux.intel.com
This commit is contained in:
parent
936e71e314
commit
f8856a44ad
3 changed files with 19 additions and 31 deletions
|
@ -134,20 +134,6 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
|
||||||
|
|
||||||
crtc_state = to_intel_crtc_state(drm_crtc_state);
|
crtc_state = to_intel_crtc_state(drm_crtc_state);
|
||||||
|
|
||||||
/*
|
|
||||||
* The original src/dest coordinates are stored in state->base, but
|
|
||||||
* we want to keep another copy internal to our driver that we can
|
|
||||||
* clip/modify ourselves.
|
|
||||||
*/
|
|
||||||
intel_state->base.src.x1 = state->src_x;
|
|
||||||
intel_state->base.src.y1 = state->src_y;
|
|
||||||
intel_state->base.src.x2 = state->src_x + state->src_w;
|
|
||||||
intel_state->base.src.y2 = state->src_y + state->src_h;
|
|
||||||
intel_state->base.dst.x1 = state->crtc_x;
|
|
||||||
intel_state->base.dst.y1 = state->crtc_y;
|
|
||||||
intel_state->base.dst.x2 = state->crtc_x + state->crtc_w;
|
|
||||||
intel_state->base.dst.y2 = state->crtc_y + state->crtc_h;
|
|
||||||
|
|
||||||
/* Clip all planes to CRTC size, or 0x0 if CRTC is disabled */
|
/* Clip all planes to CRTC size, or 0x0 if CRTC is disabled */
|
||||||
intel_state->clip.x1 = 0;
|
intel_state->clip.x1 = 0;
|
||||||
intel_state->clip.y1 = 0;
|
intel_state->clip.y1 = 0;
|
||||||
|
|
|
@ -14128,7 +14128,6 @@ intel_check_primary_plane(struct drm_plane *plane,
|
||||||
struct intel_plane_state *state)
|
struct intel_plane_state *state)
|
||||||
{
|
{
|
||||||
struct drm_crtc *crtc = state->base.crtc;
|
struct drm_crtc *crtc = state->base.crtc;
|
||||||
struct drm_framebuffer *fb = state->base.fb;
|
|
||||||
int min_scale = DRM_PLANE_HELPER_NO_SCALING;
|
int min_scale = DRM_PLANE_HELPER_NO_SCALING;
|
||||||
int max_scale = DRM_PLANE_HELPER_NO_SCALING;
|
int max_scale = DRM_PLANE_HELPER_NO_SCALING;
|
||||||
bool can_position = false;
|
bool can_position = false;
|
||||||
|
@ -14142,14 +14141,10 @@ intel_check_primary_plane(struct drm_plane *plane,
|
||||||
can_position = true;
|
can_position = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return drm_plane_helper_check_update(plane, crtc, fb,
|
return drm_plane_helper_check_state(&state->base,
|
||||||
&state->base.src,
|
&state->clip,
|
||||||
&state->base.dst,
|
min_scale, max_scale,
|
||||||
&state->base.clip,
|
can_position, true);
|
||||||
state->base.rotation,
|
|
||||||
min_scale, max_scale,
|
|
||||||
can_position, true,
|
|
||||||
&state->base.visible);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void intel_begin_crtc_commit(struct drm_crtc *crtc,
|
static void intel_begin_crtc_commit(struct drm_crtc *crtc,
|
||||||
|
@ -14329,20 +14324,17 @@ intel_check_cursor_plane(struct drm_plane *plane,
|
||||||
struct intel_crtc_state *crtc_state,
|
struct intel_crtc_state *crtc_state,
|
||||||
struct intel_plane_state *state)
|
struct intel_plane_state *state)
|
||||||
{
|
{
|
||||||
struct drm_crtc *crtc = crtc_state->base.crtc;
|
|
||||||
struct drm_framebuffer *fb = state->base.fb;
|
struct drm_framebuffer *fb = state->base.fb;
|
||||||
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
|
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
|
||||||
enum pipe pipe = to_intel_plane(plane)->pipe;
|
enum pipe pipe = to_intel_plane(plane)->pipe;
|
||||||
unsigned stride;
|
unsigned stride;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = drm_plane_helper_check_update(plane, crtc, fb, &state->base.src,
|
ret = drm_plane_helper_check_state(&state->base,
|
||||||
&state->base.dst,
|
&state->clip,
|
||||||
&state->base.clip,
|
DRM_PLANE_HELPER_NO_SCALING,
|
||||||
state->base.rotation,
|
DRM_PLANE_HELPER_NO_SCALING,
|
||||||
DRM_PLANE_HELPER_NO_SCALING,
|
true, true);
|
||||||
DRM_PLANE_HELPER_NO_SCALING,
|
|
||||||
true, true, &state->base.visible);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
|
@ -785,6 +785,16 @@ intel_check_sprite_plane(struct drm_plane *plane,
|
||||||
int max_scale, min_scale;
|
int max_scale, min_scale;
|
||||||
bool can_scale;
|
bool can_scale;
|
||||||
|
|
||||||
|
src->x1 = state->base.src_x;
|
||||||
|
src->y1 = state->base.src_y;
|
||||||
|
src->x2 = state->base.src_x + state->base.src_w;
|
||||||
|
src->y2 = state->base.src_y + state->base.src_h;
|
||||||
|
|
||||||
|
dst->x1 = state->base.crtc_x;
|
||||||
|
dst->y1 = state->base.crtc_y;
|
||||||
|
dst->x2 = state->base.crtc_x + state->base.crtc_w;
|
||||||
|
dst->y2 = state->base.crtc_y + state->base.crtc_h;
|
||||||
|
|
||||||
if (!fb) {
|
if (!fb) {
|
||||||
state->base.visible = false;
|
state->base.visible = false;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue