diff mbox series

[1/2] drm/display/dp: Default 8 bpc support when DSC is supported

Message ID 20230823115425.715644-2-ankit.k.nautiyal@intel.com (mailing list archive)
State New, archived
Headers show
Series eDP DSC fixes | expand

Commit Message

Ankit Nautiyal Aug. 23, 2023, 11:54 a.m. UTC
As per DP v1.4, a DP DSC Sink device shall support 8bpc in DPCD 6Ah.
Apparently some panels that do support DSC, are not setting the bit for
8bpc.

So always assume 8bpc support by DSC decoder, when DSC is claimed to be
supported.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/display/drm_dp_helper.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

kernel test robot Aug. 23, 2023, 4:26 p.m. UTC | #1
Hi Ankit,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-tip/drm-tip]
[also build test WARNING on linus/master v6.5-rc7 next-20230823]
[cannot apply to drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-misc/drm-misc-next]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ankit-Nautiyal/drm-display-dp-Default-8-bpc-support-when-DSC-is-supported/20230823-195946
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
patch link:    https://lore.kernel.org/r/20230823115425.715644-2-ankit.k.nautiyal%40intel.com
patch subject: [PATCH 1/2] drm/display/dp: Default 8 bpc support when DSC is supported
config: i386-randconfig-r036-20230823 (https://download.01.org/0day-ci/archive/20230824/202308240007.1edS9XsL-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20230824/202308240007.1edS9XsL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308240007.1edS9XsL-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/display/drm_dp_helper.c:2451:6: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
           if (!dsc_dpcd[DP_DSC_SUPPORT] & DP_DSC_DECOMPRESSION_IS_SUPPORTED)
               ^                         ~
   drivers/gpu/drm/display/drm_dp_helper.c:2451:6: note: add parentheses after the '!' to evaluate the bitwise operator first
           if (!dsc_dpcd[DP_DSC_SUPPORT] & DP_DSC_DECOMPRESSION_IS_SUPPORTED)
               ^
                (                                                           )
   drivers/gpu/drm/display/drm_dp_helper.c:2451:6: note: add parentheses around left hand side expression to silence this warning
           if (!dsc_dpcd[DP_DSC_SUPPORT] & DP_DSC_DECOMPRESSION_IS_SUPPORTED)
               ^
               (                        )
   1 warning generated.


vim +2451 drivers/gpu/drm/display/drm_dp_helper.c

  2428	
  2429	/**
  2430	 * drm_dp_dsc_sink_supported_input_bpcs() - Get all the input bits per component
  2431	 * values supported by the DSC sink.
  2432	 * @dsc_dpcd: DSC capabilities from DPCD
  2433	 * @dsc_bpc: An array to be filled by this helper with supported
  2434	 *           input bpcs.
  2435	 *
  2436	 * Read the DSC DPCD from the sink device to parse the supported bits per
  2437	 * component values. This is used to populate the DSC parameters
  2438	 * in the &struct drm_dsc_config by the driver.
  2439	 * Driver creates an infoframe using these parameters to populate
  2440	 * &struct drm_dsc_pps_infoframe. These are sent to the sink using DSC
  2441	 * infoframe using the helper function drm_dsc_pps_infoframe_pack()
  2442	 *
  2443	 * Returns:
  2444	 * Number of input BPC values parsed from the DPCD
  2445	 */
  2446	int drm_dp_dsc_sink_supported_input_bpcs(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE],
  2447						 u8 dsc_bpc[3])
  2448	{
  2449		int num_bpc = 0;
  2450	
> 2451		if (!dsc_dpcd[DP_DSC_SUPPORT] & DP_DSC_DECOMPRESSION_IS_SUPPORTED)
  2452			return 0;
  2453	
  2454		u8 color_depth = dsc_dpcd[DP_DSC_DEC_COLOR_DEPTH_CAP - DP_DSC_SUPPORT];
  2455	
  2456		if (color_depth & DP_DSC_12_BPC)
  2457			dsc_bpc[num_bpc++] = 12;
  2458		if (color_depth & DP_DSC_10_BPC)
  2459			dsc_bpc[num_bpc++] = 10;
  2460	
  2461		/* A DP DSC Sink devices shall support 8 bpc. */
  2462		dsc_bpc[num_bpc++] = 8;
  2463	
  2464		return num_bpc;
  2465	}
  2466	EXPORT_SYMBOL(drm_dp_dsc_sink_supported_input_bpcs);
  2467
diff mbox series

Patch

diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
index e6a78fd32380..0aa4ce17420c 100644
--- a/drivers/gpu/drm/display/drm_dp_helper.c
+++ b/drivers/gpu/drm/display/drm_dp_helper.c
@@ -2447,14 +2447,19 @@  int drm_dp_dsc_sink_supported_input_bpcs(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_S
 					 u8 dsc_bpc[3])
 {
 	int num_bpc = 0;
+
+	if (!dsc_dpcd[DP_DSC_SUPPORT] & DP_DSC_DECOMPRESSION_IS_SUPPORTED)
+		return 0;
+
 	u8 color_depth = dsc_dpcd[DP_DSC_DEC_COLOR_DEPTH_CAP - DP_DSC_SUPPORT];
 
 	if (color_depth & DP_DSC_12_BPC)
 		dsc_bpc[num_bpc++] = 12;
 	if (color_depth & DP_DSC_10_BPC)
 		dsc_bpc[num_bpc++] = 10;
-	if (color_depth & DP_DSC_8_BPC)
-		dsc_bpc[num_bpc++] = 8;
+
+	/* A DP DSC Sink devices shall support 8 bpc. */
+	dsc_bpc[num_bpc++] = 8;
 
 	return num_bpc;
 }