drm/i915/fbc: Eliminate possible_framebuffer_bits
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 15 Mar 2022 13:59:55 +0000 (15:59 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 13 Apr 2022 14:14:52 +0000 (17:14 +0300)
Not sure what the point of this fbc->possible_frontbuffer_bits is.
And especially don't see why it's returning all the bits when
fbc is not even enabled. So let's just get rid of this and only
say we are interested in the plane's frontbuffer bits when fbc
is actually enabled.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220315140001.1172-2-ville.syrjala@linux.intel.com
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_fbc.c

index b653f3ba7c66e3b8469f552cfde723f273a4b0f2..948f6bfe22331c7e0503c475c87217c1a23dbb0c 100644 (file)
@@ -90,7 +90,6 @@ struct intel_fbc {
         * with stolen_lock.
         */
        struct mutex lock;
-       unsigned int possible_framebuffer_bits;
        unsigned int busy_bits;
 
        struct drm_mm_node compressed_fb;
@@ -1317,7 +1316,7 @@ static unsigned int intel_fbc_get_frontbuffer_bit(struct intel_fbc *fbc)
        if (fbc->state.plane)
                return fbc->state.plane->frontbuffer_bit;
        else
-               return fbc->possible_framebuffer_bits;
+               return 0;
 }
 
 static void __intel_fbc_invalidate(struct intel_fbc *fbc,
@@ -1656,11 +1655,7 @@ static bool need_fbc_vtd_wa(struct drm_i915_private *i915)
 
 void intel_fbc_add_plane(struct intel_fbc *fbc, struct intel_plane *plane)
 {
-       if (!fbc)
-               return;
-
        plane->fbc = fbc;
-       fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
 }
 
 static struct intel_fbc *intel_fbc_create(struct drm_i915_private *i915,