drm/amd/display: check attr flag before set cursor degamma on DCN3+
authorjsg <jsg@openbsd.org>
Thu, 17 Aug 2023 03:39:20 +0000 (03:39 +0000)
committerjsg <jsg@openbsd.org>
Thu, 17 Aug 2023 03:39:20 +0000 (03:39 +0000)
From Melissa Wen
c3d2d4b02e5e91b465ae85a19c05b00912f79620 in linux-6.1.y/6.1.46
96b020e2163fb2197266b2f71b1007495206e6bb in mainline linux

sys/dev/pci/drm/amd/display/dc/dcn30/dcn30_dpp.c

index e5b7ef7..50dc834 100644 (file)
@@ -357,8 +357,11 @@ void dpp3_set_cursor_attributes(
        int cur_rom_en = 0;
 
        if (color_format == CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA ||
-               color_format == CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA)
-               cur_rom_en = 1;
+               color_format == CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA) {
+               if (cursor_attributes->attribute_flags.bits.ENABLE_CURSOR_DEGAMMA) {
+                       cur_rom_en = 1;
+               }
+       }
 
        REG_UPDATE_3(CURSOR0_CONTROL,
                        CUR0_MODE, color_format,