Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Shirish S and committed by
Alex Deucher
3eab7916 96687275

+25 -15
+10
drivers/gpu/drm/amd/display/Kconfig
··· 17 17 by default. This includes Polaris, Carrizo, Tonga, Bonaire, 18 18 and Hawaii. 19 19 20 + config DRM_AMD_DC_FBC 21 + bool "AMD FBC - Enable Frame Buffer Compression" 22 + depends on DRM_AMD_DC 23 + help 24 + Choose this option if you want to use frame buffer compression 25 + support. 26 + This is a power optimisation feature, check its availability 27 + on your hardware before enabling this option. 28 + 29 + 20 30 config DRM_AMD_DC_DCN1_0 21 31 bool "DCN 1.0 Raven family" 22 32 depends on DRM_AMD_DC && X86
+1 -1
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 507 507 508 508 dc_version = resource_parse_asic_id(init_params->asic_id); 509 509 dc->ctx->dce_version = dc_version; 510 - #ifdef ENABLE_FBC 510 + #if defined(CONFIG_DRM_AMD_DC_FBC) 511 511 dc->ctx->fbc_gpu_addr = init_params->fbc_gpu_addr; 512 512 #endif 513 513 /* Resource should construct all asic specific resources.
+2 -2
drivers/gpu/drm/amd/display/dc/dc.h
··· 258 258 struct dm_pp_display_configuration prev_display_config; 259 259 260 260 /* FBC compressor */ 261 - #ifdef ENABLE_FBC 261 + #if defined(CONFIG_DRM_AMD_DC_FBC) 262 262 struct compressor *fbc_compressor; 263 263 #endif 264 264 }; ··· 293 293 294 294 struct dc_config flags; 295 295 uint32_t log_mask; 296 - #ifdef ENABLE_FBC 296 + #if defined(CONFIG_DRM_AMD_DC_FBC) 297 297 uint64_t fbc_gpu_addr; 298 298 #endif 299 299 };
+1 -1
drivers/gpu/drm/amd/display/dc/dc_types.h
··· 92 92 bool created_bios; 93 93 struct gpio_service *gpio_service; 94 94 struct i2caux *i2caux; 95 - #ifdef ENABLE_FBC 95 + #if defined(CONFIG_DRM_AMD_DC_FBC) 96 96 uint64_t fbc_gpu_addr; 97 97 #endif 98 98 };
+1 -1
drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
··· 514 514 compressor->base.lpt_channels_num = 0; 515 515 compressor->base.attached_inst = 0; 516 516 compressor->base.is_enabled = false; 517 - #ifdef ENABLE_FBC 517 + #if defined(CONFIG_DRM_AMD_DC_FBC) 518 518 compressor->base.funcs = &dce110_compressor_funcs; 519 519 520 520 #endif
+8 -8
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
··· 34 34 #include "dce/dce_hwseq.h" 35 35 #include "gpio_service_interface.h" 36 36 37 - #ifdef ENABLE_FBC 37 + #if defined(CONFIG_DRM_AMD_DC_FBC) 38 38 #include "dce110_compressor.h" 39 39 #endif 40 40 ··· 1445 1445 1446 1446 power_down_clock_sources(dc); 1447 1447 1448 - #ifdef ENABLE_FBC 1448 + #if defined(CONFIG_DRM_AMD_DC_FBC) 1449 1449 if (dc->fbc_compressor) 1450 1450 dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor); 1451 1451 #endif ··· 1618 1618 if (events->cursor_update) 1619 1619 value |= 0x2; 1620 1620 1621 - #ifdef ENABLE_FBC 1621 + #if defined(CONFIG_DRM_AMD_DC_FBC) 1622 1622 value |= 0x84; 1623 1623 #endif 1624 1624 ··· 1748 1748 } 1749 1749 } 1750 1750 1751 - #ifdef ENABLE_FBC 1751 + #if defined(CONFIG_DRM_AMD_DC_FBC) 1752 1752 1753 1753 /* 1754 1754 * Check if FBC can be enabled ··· 1940 1940 1941 1941 set_safe_displaymarks(&context->res_ctx, dc->res_pool); 1942 1942 1943 - #ifdef ENABLE_FBC 1943 + #if defined(CONFIG_DRM_AMD_DC_FBC) 1944 1944 if (dc->fbc_compressor) 1945 1945 dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor); 1946 1946 #endif ··· 2124 2124 2125 2125 dcb->funcs->set_scratch_critical_state(dcb, false); 2126 2126 2127 - #ifdef ENABLE_FBC 2127 + #if defined(CONFIG_DRM_AMD_DC_FBC) 2128 2128 if (dc->fbc_compressor) 2129 2129 enable_fbc(dc, context); 2130 2130 ··· 2533 2533 abm->funcs->init_backlight(abm); 2534 2534 abm->funcs->abm_init(abm); 2535 2535 } 2536 - #ifdef ENABLE_FBC 2536 + #if defined(CONFIG_DRM_AMD_DC_FBC) 2537 2537 if (dc->fbc_compressor) 2538 2538 dc->fbc_compressor->funcs->power_up_fbc(dc->fbc_compressor); 2539 2539 #endif ··· 2781 2781 2782 2782 program_scaler(dc, pipe_ctx); 2783 2783 2784 - #ifdef ENABLE_FBC 2784 + #if defined(CONFIG_DRM_AMD_DC_FBC) 2785 2785 if (dc->fbc_compressor && old_pipe->stream) { 2786 2786 if (plane_state->tiling_info.gfx8.array_mode == DC_ARRAY_LINEAR_GENERAL) 2787 2787 dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
+2 -2
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
··· 52 52 #include "dce/dce_abm.h" 53 53 #include "dce/dce_dmcu.h" 54 54 55 - #ifdef ENABLE_FBC 55 + #if defined(CONFIG_DRM_AMD_DC_FBC) 56 56 #include "dce110/dce110_compressor.h" 57 57 #endif 58 58 ··· 1279 1279 } 1280 1280 } 1281 1281 1282 - #ifdef ENABLE_FBC 1282 + #if defined(CONFIG_DRM_AMD_DC_FBC) 1283 1283 dc->fbc_compressor = dce110_compressor_create(ctx); 1284 1284 1285 1285