Enable pipe dithering while enabling histogram to overcome some
atrifacts seen on the screen.

Signed-off-by: Arun R Murthy <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_histogram.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_histogram.c 
b/drivers/gpu/drm/i915/display/intel_histogram.c
index 
1d02f4fdf8549a0fd7a46dbd8fdc218798c2de1b..152ae1d0393e9b2b331612494e0cf918edc6f999
 100644
--- a/drivers/gpu/drm/i915/display/intel_histogram.c
+++ b/drivers/gpu/drm/i915/display/intel_histogram.c
@@ -9,10 +9,10 @@
 #include <drm/drm_vblank.h>
 #include <drm/drm_print.h>
 
-#include "i915_reg.h"
 #include "i915_drv.h"
 #include "intel_de.h"
 #include "intel_display.h"
+#include "intel_display_regs.h"
 #include "intel_display_types.h"
 #include "intel_histogram.h"
 #include "intel_histogram_regs.h"
@@ -24,6 +24,13 @@
 #define HISTOGRAM_BIN_READ_RETRY_COUNT 5
 #define IET_SAMPLE_FORMAT_1_INT_9_FRACT 0x1000009
 
+static void intel_histogram_enable_dithering(struct intel_display *display,
+                                            enum pipe pipe)
+{
+       intel_de_rmw(display, PIPE_MISC(pipe), PIPE_MISC_DITHER_ENABLE,
+                    PIPE_MISC_DITHER_ENABLE);
+}
+
 static void set_bin_index_0(struct intel_display *display, enum pipe pipe)
 {
        if (DISPLAY_VER(display) >= 20)
@@ -204,6 +211,10 @@ static int intel_histogram_enable(struct intel_crtc 
*intel_crtc, u8 mode)
 
        if (histogram->enable)
                return 0;
+
+       /* Pipe Dithering should be enabled with histogram */
+       intel_histogram_enable_dithering(display, pipe);
+
         /* enable histogram, clear DPST_BIN reg and select TC function */
        if (DISPLAY_VER(display) >= 20)
                intel_de_rmw(display, DPST_CTL(pipe),

-- 
2.25.1

Reply via email to