aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2520-drm-amd-display-make-FBC-configurable-option.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2520-drm-amd-display-make-FBC-configurable-option.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2520-drm-amd-display-make-FBC-configurable-option.patch208
1 files changed, 208 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2520-drm-amd-display-make-FBC-configurable-option.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2520-drm-amd-display-make-FBC-configurable-option.patch
new file mode 100644
index 00000000..d7571f72
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2520-drm-amd-display-make-FBC-configurable-option.patch
@@ -0,0 +1,208 @@
+From e3282b440ab010ad1712fbb60780bb3be8acae35 Mon Sep 17 00:00:00 2001
+From: Shirish S <shirish.s@amd.com>
+Date: Tue, 26 Sep 2017 15:35:42 +0530
+Subject: [PATCH 2520/4131] drm/amd/display: make FBC configurable option
+
+Currently FBC is guarded with ENABLE_FBC macro,
+which needs to be manually enabled in Makefile.
+
+This patch moves it to Kconfig so that there
+wont be any need to additional patch to be carried
+for enabling or disabling on every SoC.
+
+Signed-off-by: Shirish S <shirish.s@amd.com>
+Reviewed-by: Roman Li <Roman.Li@amd.com>
+Acked-by: Harry Wentland <Harry.Wentland@amd.com>
+---
+ drivers/gpu/drm/amd/display/Kconfig | 10 ++++++++++
+ drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +-
+ drivers/gpu/drm/amd/display/dc/dc.h | 4 ++--
+ drivers/gpu/drm/amd/display/dc/dc_types.h | 2 +-
+ .../gpu/drm/amd/display/dc/dce110/dce110_compressor.c | 2 +-
+ .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 16 ++++++++--------
+ drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 4 ++--
+ 7 files changed, 25 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
+index 21b6b5b..7aed462 100644
+--- a/drivers/gpu/drm/amd/display/Kconfig
++++ b/drivers/gpu/drm/amd/display/Kconfig
+@@ -9,6 +9,16 @@ config DRM_AMD_DC
+
+ Will be deprecated when the DC component is upstream.
+
++config DRM_AMD_DC_FBC
++ bool "AMD FBC - Enable Frame Buffer Compression"
++ depends on DRM_AMD_DC
++ help
++ Choose this option if you want to use frame buffer compression
++ support.
++ This is a power optimisation feature, check its availability
++ on your hardware before enabling this option.
++
++
+ config DRM_AMD_DC_DCN1_0
+ bool "DCN 1.0 Raven family"
+ depends on DRM_AMD_DC && X86
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
+index d733658..8fdb06b 100644
+--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
++++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
+@@ -507,7 +507,7 @@ static bool construct(struct dc *dc,
+
+ dc_version = resource_parse_asic_id(init_params->asic_id);
+ dc->ctx->dce_version = dc_version;
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ dc->ctx->fbc_gpu_addr = init_params->fbc_gpu_addr;
+ #endif
+ /* Resource should construct all asic specific resources.
+diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
+index 72440e3..e26dc71 100644
+--- a/drivers/gpu/drm/amd/display/dc/dc.h
++++ b/drivers/gpu/drm/amd/display/dc/dc.h
+@@ -258,7 +258,7 @@ struct dc {
+ struct dm_pp_display_configuration prev_display_config;
+
+ /* FBC compressor */
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ struct compressor *fbc_compressor;
+ #endif
+ };
+@@ -293,7 +293,7 @@ struct dc_init_data {
+
+ struct dc_config flags;
+ uint32_t log_mask;
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ uint64_t fbc_gpu_addr;
+ #endif
+ };
+diff --git a/drivers/gpu/drm/amd/display/dc/dc_types.h b/drivers/gpu/drm/amd/display/dc/dc_types.h
+index 4bd74fc..a8698e3 100644
+--- a/drivers/gpu/drm/amd/display/dc/dc_types.h
++++ b/drivers/gpu/drm/amd/display/dc/dc_types.h
+@@ -92,7 +92,7 @@ struct dc_context {
+ bool created_bios;
+ struct gpio_service *gpio_service;
+ struct i2caux *i2caux;
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ uint64_t fbc_gpu_addr;
+ #endif
+ };
+diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
+index 3872feb..6923662 100644
+--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
++++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
+@@ -514,7 +514,7 @@ void dce110_compressor_construct(struct dce110_compressor *compressor,
+ compressor->base.lpt_channels_num = 0;
+ compressor->base.attached_inst = 0;
+ compressor->base.is_enabled = false;
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ compressor->base.funcs = &dce110_compressor_funcs;
+
+ #endif
+diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+index 8b7b1be..3ced84c 100644
+--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
++++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+@@ -34,7 +34,7 @@
+ #include "dce/dce_hwseq.h"
+ #include "gpio_service_interface.h"
+
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ #include "dce110_compressor.h"
+ #endif
+
+@@ -1440,7 +1440,7 @@ static void power_down_all_hw_blocks(struct dc *dc)
+
+ power_down_clock_sources(dc);
+
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ if (dc->fbc_compressor)
+ dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
+ #endif
+@@ -1613,7 +1613,7 @@ static void set_static_screen_control(struct pipe_ctx **pipe_ctx,
+ if (events->cursor_update)
+ value |= 0x2;
+
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ value |= 0x84;
+ #endif
+
+@@ -1743,7 +1743,7 @@ static void apply_min_clocks(
+ }
+ }
+
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+
+ /*
+ * Check if FBC can be enabled
+@@ -1935,7 +1935,7 @@ enum dc_status dce110_apply_ctx_to_hw(
+
+ set_safe_displaymarks(&context->res_ctx, dc->res_pool);
+
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ if (dc->fbc_compressor)
+ dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
+ #endif
+@@ -2119,7 +2119,7 @@ enum dc_status dce110_apply_ctx_to_hw(
+
+ dcb->funcs->set_scratch_critical_state(dcb, false);
+
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ if (dc->fbc_compressor)
+ enable_fbc(dc, context);
+
+@@ -2528,7 +2528,7 @@ static void init_hw(struct dc *dc)
+ abm->funcs->init_backlight(abm);
+ abm->funcs->abm_init(abm);
+ }
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ if (dc->fbc_compressor)
+ dc->fbc_compressor->funcs->power_up_fbc(dc->fbc_compressor);
+ #endif
+@@ -2776,7 +2776,7 @@ static void dce110_program_front_end_for_pipe(
+
+ program_scaler(dc, pipe_ctx);
+
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ if (dc->fbc_compressor && old_pipe->stream) {
+ if (plane_state->tiling_info.gfx8.array_mode == DC_ARRAY_LINEAR_GENERAL)
+ dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
+diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
+index 8e4ec61..db96d2b 100644
+--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
++++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
+@@ -52,7 +52,7 @@
+ #include "dce/dce_abm.h"
+ #include "dce/dce_dmcu.h"
+
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ #include "dce110/dce110_compressor.h"
+ #endif
+
+@@ -1279,7 +1279,7 @@ static bool construct(
+ }
+ }
+
+-#ifdef ENABLE_FBC
++#if defined(CONFIG_DRM_AMD_DC_FBC)
+ dc->fbc_compressor = dce110_compressor_create(ctx);
+
+
+--
+2.7.4
+