提交 e3c566df 编写于 作者: V Ville Syrjälä

drm/i915: Remove some duplicated plane swapping logic

On pre-gen4 we connect plane A to pipe B and vice versa to get an FBC
capable plane feeding the LVDS port by default. We have the logic for
the plane swapping duplicated in many places. Let's remove a bit of the
duplication by having the crtc look up the thing from the primary plane.
Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1478616439-10150-2-git-send-email-ville.syrjala@linux.intel.comReviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
上级 c99f53f7
...@@ -15013,11 +15013,16 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) ...@@ -15013,11 +15013,16 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
state->scaler_id = -1; state->scaler_id = -1;
} }
primary->pipe = pipe; primary->pipe = pipe;
primary->plane = pipe; /*
* On gen2/3 only plane A can do FBC, but the panel fitter and LVDS
* port is hooked to pipe B. Hence we want plane A feeding pipe B.
*/
if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
primary->plane = (enum plane) !pipe;
else
primary->plane = (enum plane) pipe;
primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe); primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe);
primary->check_plane = intel_check_primary_plane; primary->check_plane = intel_check_primary_plane;
if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
primary->plane = !pipe;
if (INTEL_GEN(dev_priv) >= 9) { if (INTEL_GEN(dev_priv) >= 9) {
intel_primary_formats = skl_primary_formats; intel_primary_formats = skl_primary_formats;
...@@ -15327,16 +15332,8 @@ static int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe) ...@@ -15327,16 +15332,8 @@ static int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
if (ret) if (ret)
goto fail; goto fail;
/*
* On gen2/3 only plane A can do fbc, but the panel fitter and lvds port
* is hooked to pipe B. Hence we want plane A feeding pipe B.
*/
intel_crtc->pipe = pipe; intel_crtc->pipe = pipe;
intel_crtc->plane = (enum plane) pipe; intel_crtc->plane = primary->plane;
if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4) {
DRM_DEBUG_KMS("swapping pipes & planes for FBC\n");
intel_crtc->plane = !pipe;
}
intel_crtc->cursor_base = ~0; intel_crtc->cursor_base = ~0;
intel_crtc->cursor_cntl = ~0; intel_crtc->cursor_cntl = ~0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册