All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: fix gcc set but not used warning of variable 'link_bandwidth_kbps'
@ 2021-05-29  9:30 ` Yu Kuai
  0 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2021-05-29  9:30 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	Xinhui.Pan, airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel, yukuai3, yi.zhang

apply_dsc_policy_for_stream() will only be used if
'CONFIG_DRM_AMD_DC_DCN' is enabled, thus the function can be
declared inside the ifdefine marco.

Fix gcc warning:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5577:11: warning:
 variable ‘link_bandwidth_kbps’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index f0adfda32213..f7a5e5b48ea6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5569,6 +5569,7 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
 	}
 }
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
 static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 										struct dc_sink *sink, struct dc_stream_state *stream,
 										struct dsc_dec_dpcd_caps *dsc_caps)
@@ -5578,7 +5579,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 
 	link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
 							dc_link_get_link_cap(aconnector->dc_link));
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	/* Set DSC policy according to dsc_clock_en */
 	dc_dsc_policy_set_enable_dsc_when_not_needed(
 		aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] drm/amd/display: fix gcc set but not used warning of variable 'link_bandwidth_kbps'
@ 2021-05-29  9:30 ` Yu Kuai
  0 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2021-05-29  9:30 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	Xinhui.Pan, airlied, daniel
  Cc: yukuai3, yi.zhang, dri-devel, amd-gfx, linux-kernel

apply_dsc_policy_for_stream() will only be used if
'CONFIG_DRM_AMD_DC_DCN' is enabled, thus the function can be
declared inside the ifdefine marco.

Fix gcc warning:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5577:11: warning:
 variable ‘link_bandwidth_kbps’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index f0adfda32213..f7a5e5b48ea6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5569,6 +5569,7 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
 	}
 }
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
 static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 										struct dc_sink *sink, struct dc_stream_state *stream,
 										struct dsc_dec_dpcd_caps *dsc_caps)
@@ -5578,7 +5579,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 
 	link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
 							dc_link_get_link_cap(aconnector->dc_link));
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	/* Set DSC policy according to dsc_clock_en */
 	dc_dsc_policy_set_enable_dsc_when_not_needed(
 		aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] drm/amd/display: fix gcc set but not used warning of variable 'link_bandwidth_kbps'
@ 2021-05-29  9:30 ` Yu Kuai
  0 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2021-05-29  9:30 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	Xinhui.Pan, airlied, daniel
  Cc: yukuai3, yi.zhang, dri-devel, amd-gfx, linux-kernel

apply_dsc_policy_for_stream() will only be used if
'CONFIG_DRM_AMD_DC_DCN' is enabled, thus the function can be
declared inside the ifdefine marco.

Fix gcc warning:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5577:11: warning:
 variable ‘link_bandwidth_kbps’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index f0adfda32213..f7a5e5b48ea6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5569,6 +5569,7 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
 	}
 }
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
 static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 										struct dc_sink *sink, struct dc_stream_state *stream,
 										struct dsc_dec_dpcd_caps *dsc_caps)
@@ -5578,7 +5579,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 
 	link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
 							dc_link_get_link_cap(aconnector->dc_link));
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	/* Set DSC policy according to dsc_clock_en */
 	dc_dsc_policy_set_enable_dsc_when_not_needed(
 		aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amd/display: fix gcc set but not used warning of variable 'link_bandwidth_kbps'
  2021-05-29  9:30 ` Yu Kuai
@ 2021-05-29 12:59   ` kernel test robot
  -1 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-05-29 12:59 UTC (permalink / raw)
  To: Yu Kuai, harry.wentland, sunpeng.li, alexander.deucher,
	christian.koenig, Xinhui.Pan, airlied, daniel
  Cc: yukuai3, kbuild-all, dri-devel, yi.zhang

[-- Attachment #1: Type: text/plain, Size: 6181 bytes --]

Hi Yu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20210528]
[cannot apply to linus/master v5.13-rc3 v5.13-rc2 v5.13-rc1 v5.13-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yu-Kuai/drm-amd-display-fix-gcc-set-but-not-used-warning-of-variable-link_bandwidth_kbps/20210529-172249
base:    3e029760e6f8ce90c122c267a039ae73b3f1f5a4
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/c93bfe4f39d5c59531a0903c476df1f7319c06d1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yu-Kuai/drm-amd-display-fix-gcc-set-but-not-used-warning-of-variable-link_bandwidth_kbps/20210529-172249
        git checkout c93bfe4f39d5c59531a0903c476df1f7319c06d1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5613:1: error: expected identifier or '(' before '}' token
    5613 | }
         | ^
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'validate_overlay':
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:10066:26: warning: variable 'old_plane_state' set but not used [-Wunused-but-set-variable]
   10066 |  struct drm_plane_state *old_plane_state, *new_plane_state;
         |                          ^~~~~~~~~~~~~~~
   At top level:
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5556:13: warning: 'update_dsc_caps' defined but not used [-Wunused-function]
    5556 | static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
         |             ^~~~~~~~~~~~~~~


vim +5613 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c

998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5571  
c93bfe4f39d5c5 Yu Kuai     2021-05-29  5572  #if defined(CONFIG_DRM_AMD_DC_DCN)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5573  static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5574  										struct dc_sink *sink, struct dc_stream_state *stream,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5575  										struct dsc_dec_dpcd_caps *dsc_caps)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5576  {
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5577  	struct drm_connector *drm_connector = &aconnector->base;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5578  	uint32_t link_bandwidth_kbps;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5579  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5580  	link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5581  							dc_link_get_link_cap(aconnector->dc_link));
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5582  	/* Set DSC policy according to dsc_clock_en */
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5583  	dc_dsc_policy_set_enable_dsc_when_not_needed(
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5584  		aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5585  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5586  	if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5587  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5588  		if (dc_dsc_compute_config(aconnector->dc_link->ctx->dc->res_pool->dscs[0],
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5589  						dsc_caps,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5590  						aconnector->dc_link->ctx->dc->debug.dsc_min_slice_height_override,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5591  						0,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5592  						link_bandwidth_kbps,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5593  						&stream->timing,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5594  						&stream->timing.dsc_cfg)) {
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5595  			stream->timing.flags.DSC = 1;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5596  			DRM_DEBUG_DRIVER("%s: [%s] DSC is selected from SST RX\n", __func__, drm_connector->name);
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5597  		}
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5598  	}
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5599  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5600  	/* Overwrite the stream flag if DSC is enabled through debugfs */
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5601  	if (aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5602  		stream->timing.flags.DSC = 1;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5603  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5604  	if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_num_slices_h)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5605  		stream->timing.dsc_cfg.num_slices_h = aconnector->dsc_settings.dsc_num_slices_h;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5606  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5607  	if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_num_slices_v)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5608  		stream->timing.dsc_cfg.num_slices_v = aconnector->dsc_settings.dsc_num_slices_v;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5609  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5610  	if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5611  		stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5612  #endif
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13 @5613  }
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5614  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 64699 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amd/display: fix gcc set but not used warning of variable 'link_bandwidth_kbps'
@ 2021-05-29 12:59   ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-05-29 12:59 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6275 bytes --]

Hi Yu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20210528]
[cannot apply to linus/master v5.13-rc3 v5.13-rc2 v5.13-rc1 v5.13-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yu-Kuai/drm-amd-display-fix-gcc-set-but-not-used-warning-of-variable-link_bandwidth_kbps/20210529-172249
base:    3e029760e6f8ce90c122c267a039ae73b3f1f5a4
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/c93bfe4f39d5c59531a0903c476df1f7319c06d1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yu-Kuai/drm-amd-display-fix-gcc-set-but-not-used-warning-of-variable-link_bandwidth_kbps/20210529-172249
        git checkout c93bfe4f39d5c59531a0903c476df1f7319c06d1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5613:1: error: expected identifier or '(' before '}' token
    5613 | }
         | ^
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'validate_overlay':
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:10066:26: warning: variable 'old_plane_state' set but not used [-Wunused-but-set-variable]
   10066 |  struct drm_plane_state *old_plane_state, *new_plane_state;
         |                          ^~~~~~~~~~~~~~~
   At top level:
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5556:13: warning: 'update_dsc_caps' defined but not used [-Wunused-function]
    5556 | static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
         |             ^~~~~~~~~~~~~~~


vim +5613 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c

998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5571  
c93bfe4f39d5c5 Yu Kuai     2021-05-29  5572  #if defined(CONFIG_DRM_AMD_DC_DCN)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5573  static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5574  										struct dc_sink *sink, struct dc_stream_state *stream,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5575  										struct dsc_dec_dpcd_caps *dsc_caps)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5576  {
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5577  	struct drm_connector *drm_connector = &aconnector->base;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5578  	uint32_t link_bandwidth_kbps;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5579  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5580  	link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5581  							dc_link_get_link_cap(aconnector->dc_link));
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5582  	/* Set DSC policy according to dsc_clock_en */
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5583  	dc_dsc_policy_set_enable_dsc_when_not_needed(
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5584  		aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5585  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5586  	if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5587  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5588  		if (dc_dsc_compute_config(aconnector->dc_link->ctx->dc->res_pool->dscs[0],
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5589  						dsc_caps,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5590  						aconnector->dc_link->ctx->dc->debug.dsc_min_slice_height_override,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5591  						0,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5592  						link_bandwidth_kbps,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5593  						&stream->timing,
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5594  						&stream->timing.dsc_cfg)) {
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5595  			stream->timing.flags.DSC = 1;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5596  			DRM_DEBUG_DRIVER("%s: [%s] DSC is selected from SST RX\n", __func__, drm_connector->name);
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5597  		}
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5598  	}
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5599  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5600  	/* Overwrite the stream flag if DSC is enabled through debugfs */
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5601  	if (aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5602  		stream->timing.flags.DSC = 1;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5603  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5604  	if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_num_slices_h)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5605  		stream->timing.dsc_cfg.num_slices_h = aconnector->dsc_settings.dsc_num_slices_h;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5606  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5607  	if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_num_slices_v)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5608  		stream->timing.dsc_cfg.num_slices_v = aconnector->dsc_settings.dsc_num_slices_v;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5609  
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5610  	if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5611  		stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5612  #endif
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13 @5613  }
998b7ad2efd4c5 Fangzhi Zuo 2021-05-13  5614  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 64699 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V2] drm/amd/display: fix gcc set but not used warning of variable 'link_bandwidth_kbps'
  2021-05-29  9:30 ` Yu Kuai
  (?)
@ 2021-05-31  2:14   ` Yu Kuai
  -1 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2021-05-31  2:14 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	Xinhui.Pan, airlied, daniel
  Cc: amd-gfx, dri-devel, linux-kernel, yukuai3, yi.zhang

apply_dsc_policy_for_stream() will only be used if
'CONFIG_DRM_AMD_DC_DCN' is enabled, thus the function can be
declared inside the ifdefine marco.

Fix gcc warning:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5577:11: warning:
 variable ‘link_bandwidth_kbps’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
changes in V2:
 - fix that forgetting to change position of '#endif'
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index a280cad7c4ca..c2ae88af70cd 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5569,6 +5569,7 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
 	}
 }
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
 static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 										struct dc_sink *sink, struct dc_stream_state *stream,
 										struct dsc_dec_dpcd_caps *dsc_caps)
@@ -5578,7 +5579,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 
 	link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
 							dc_link_get_link_cap(aconnector->dc_link));
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	/* Set DSC policy according to dsc_clock_en */
 	dc_dsc_policy_set_enable_dsc_when_not_needed(
 		aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
@@ -5609,8 +5609,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 
 	if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
 		stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
-#endif
 }
+#endif
 
 static struct drm_display_mode *
 get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V2] drm/amd/display: fix gcc set but not used warning of variable 'link_bandwidth_kbps'
@ 2021-05-31  2:14   ` Yu Kuai
  0 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2021-05-31  2:14 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	Xinhui.Pan, airlied, daniel
  Cc: yukuai3, yi.zhang, dri-devel, amd-gfx, linux-kernel

apply_dsc_policy_for_stream() will only be used if
'CONFIG_DRM_AMD_DC_DCN' is enabled, thus the function can be
declared inside the ifdefine marco.

Fix gcc warning:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5577:11: warning:
 variable ‘link_bandwidth_kbps’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
changes in V2:
 - fix that forgetting to change position of '#endif'
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index a280cad7c4ca..c2ae88af70cd 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5569,6 +5569,7 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
 	}
 }
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
 static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 										struct dc_sink *sink, struct dc_stream_state *stream,
 										struct dsc_dec_dpcd_caps *dsc_caps)
@@ -5578,7 +5579,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 
 	link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
 							dc_link_get_link_cap(aconnector->dc_link));
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	/* Set DSC policy according to dsc_clock_en */
 	dc_dsc_policy_set_enable_dsc_when_not_needed(
 		aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
@@ -5609,8 +5609,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 
 	if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
 		stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
-#endif
 }
+#endif
 
 static struct drm_display_mode *
 get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V2] drm/amd/display: fix gcc set but not used warning of variable 'link_bandwidth_kbps'
@ 2021-05-31  2:14   ` Yu Kuai
  0 siblings, 0 replies; 8+ messages in thread
From: Yu Kuai @ 2021-05-31  2:14 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	Xinhui.Pan, airlied, daniel
  Cc: yukuai3, yi.zhang, dri-devel, amd-gfx, linux-kernel

apply_dsc_policy_for_stream() will only be used if
'CONFIG_DRM_AMD_DC_DCN' is enabled, thus the function can be
declared inside the ifdefine marco.

Fix gcc warning:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5577:11: warning:
 variable ‘link_bandwidth_kbps’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
changes in V2:
 - fix that forgetting to change position of '#endif'
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index a280cad7c4ca..c2ae88af70cd 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5569,6 +5569,7 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
 	}
 }
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
 static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 										struct dc_sink *sink, struct dc_stream_state *stream,
 										struct dsc_dec_dpcd_caps *dsc_caps)
@@ -5578,7 +5579,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 
 	link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
 							dc_link_get_link_cap(aconnector->dc_link));
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	/* Set DSC policy according to dsc_clock_en */
 	dc_dsc_policy_set_enable_dsc_when_not_needed(
 		aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
@@ -5609,8 +5609,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
 
 	if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
 		stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
-#endif
 }
+#endif
 
 static struct drm_display_mode *
 get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-05-31  8:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-29  9:30 [PATCH] drm/amd/display: fix gcc set but not used warning of variable 'link_bandwidth_kbps' Yu Kuai
2021-05-29  9:30 ` Yu Kuai
2021-05-29  9:30 ` Yu Kuai
2021-05-29 12:59 ` kernel test robot
2021-05-29 12:59   ` kernel test robot
2021-05-31  2:14 ` [PATCH V2] " Yu Kuai
2021-05-31  2:14   ` Yu Kuai
2021-05-31  2:14   ` Yu Kuai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.