Commit c19e1124 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Use enum plane_id for frontbuffer tracking

Replace the ad-hoc plane indexing scheme used by the frontbuffer
tracking with enum plane_id.

The old video overlay not being part of the plane_id namespace
will just be given the high bit.

v2: Drop the unintended whitespace change (Chris)
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180123183343.9181-1-ville.syrjala@linux.intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 84a10749
...@@ -2410,16 +2410,11 @@ enum hdmi_force_audio { ...@@ -2410,16 +2410,11 @@ enum hdmi_force_audio {
* *
* We have one bit per pipe and per scanout plane type. * We have one bit per pipe and per scanout plane type.
*/ */
#define INTEL_MAX_SPRITE_BITS_PER_PIPE 5
#define INTEL_FRONTBUFFER_BITS_PER_PIPE 8 #define INTEL_FRONTBUFFER_BITS_PER_PIPE 8
#define INTEL_FRONTBUFFER_PRIMARY(pipe) \ #define INTEL_FRONTBUFFER(pipe, plane_id) \
(1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))) (1 << ((plane_id) + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
#define INTEL_FRONTBUFFER_CURSOR(pipe) \
(1 << (1 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
#define INTEL_FRONTBUFFER_SPRITE(pipe, plane) \
(1 << (2 + plane + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
#define INTEL_FRONTBUFFER_OVERLAY(pipe) \ #define INTEL_FRONTBUFFER_OVERLAY(pipe) \
(1 << (2 + INTEL_MAX_SPRITE_BITS_PER_PIPE + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))) (1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE - 1 + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
#define INTEL_FRONTBUFFER_ALL_MASK(pipe) \ #define INTEL_FRONTBUFFER_ALL_MASK(pipe) \
(0xff << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))) (0xff << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
......
...@@ -13149,7 +13149,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) ...@@ -13149,7 +13149,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
else else
primary->i9xx_plane = (enum i9xx_plane_id) pipe; primary->i9xx_plane = (enum i9xx_plane_id) pipe;
primary->id = PLANE_PRIMARY; primary->id = PLANE_PRIMARY;
primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe); primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id);
primary->check_plane = intel_check_primary_plane; primary->check_plane = intel_check_primary_plane;
if (INTEL_GEN(dev_priv) >= 9) { if (INTEL_GEN(dev_priv) >= 9) {
...@@ -13270,7 +13270,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv, ...@@ -13270,7 +13270,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
cursor->pipe = pipe; cursor->pipe = pipe;
cursor->i9xx_plane = (enum i9xx_plane_id) pipe; cursor->i9xx_plane = (enum i9xx_plane_id) pipe;
cursor->id = PLANE_CURSOR; cursor->id = PLANE_CURSOR;
cursor->frontbuffer_bit = INTEL_FRONTBUFFER_CURSOR(pipe); cursor->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, cursor->id);
if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) { if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) {
cursor->update_plane = i845_update_cursor; cursor->update_plane = i845_update_cursor;
......
...@@ -1373,7 +1373,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv) ...@@ -1373,7 +1373,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
for_each_pipe(dev_priv, pipe) { for_each_pipe(dev_priv, pipe) {
fbc->possible_framebuffer_bits |= fbc->possible_framebuffer_bits |=
INTEL_FRONTBUFFER_PRIMARY(pipe); INTEL_FRONTBUFFER(pipe, PLANE_PRIMARY);
if (fbc_on_pipe_a_only(dev_priv)) if (fbc_on_pipe_a_only(dev_priv))
break; break;
......
...@@ -1423,7 +1423,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv, ...@@ -1423,7 +1423,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
intel_plane->pipe = pipe; intel_plane->pipe = pipe;
intel_plane->i9xx_plane = plane; intel_plane->i9xx_plane = plane;
intel_plane->id = PLANE_SPRITE0 + plane; intel_plane->id = PLANE_SPRITE0 + plane;
intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER_SPRITE(pipe, plane); intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, intel_plane->id);
intel_plane->check_plane = intel_check_sprite_plane; intel_plane->check_plane = intel_check_sprite_plane;
possible_crtcs = (1 << pipe); possible_crtcs = (1 << pipe);
......
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