diff mbox series

[V3,7/7] drm/i915/dsi: Send proper brightness value via MIPI DCS command

Message ID 20210723070548.29315-8-shawn.c.lee@intel.com (mailing list archive)
State New, archived
Headers show
Series MIPI DSI driver enhancements | expand

Commit Message

Lee, Shawn C July 23, 2021, 7:05 a.m. UTC
Driver has to swap the endian before send brightness level value
to tcon.

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
Cc: Cooper Chiou <cooper.chiou@intel.com>
Cc: William Tseng <william.tseng@intel.com>
Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

kernel test robot July 23, 2021, 11:14 a.m. UTC | #1
Hi Lee,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip v5.14-rc2 next-20210723]
[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/Lee-Shawn-C/MIPI-DSI-driver-enhancements/20210723-150019
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-s031-20210723 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/3c3b297d0e553591be7fb6d5b66bb41cf23bff42
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Lee-Shawn-C/MIPI-DSI-driver-enhancements/20210723-150019
        git checkout 3c3b297d0e553591be7fb6d5b66bb41cf23bff42
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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


sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c:69:20: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned short [usertype] data @@     got restricted __be16 [usertype] @@
   drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c:69:20: sparse:     expected unsigned short [usertype] data
   drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c:69:20: sparse:     got restricted __be16 [usertype]

vim +69 drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c

    64	
    65	static void dcs_set_backlight(const struct drm_connector_state *conn_state, u32 level)
    66	{
    67		struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(conn_state->best_encoder));
    68		struct mipi_dsi_device *dsi_device;
  > 69		u16 data = cpu_to_be16(level);
    70		enum port port;
    71	
    72		for_each_dsi_port(port, intel_dsi->dcs_backlight_ports) {
    73			dsi_device = intel_dsi->dsi_hosts[port]->device;
    74			mipi_dsi_dcs_write(dsi_device, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,
    75					   &data, sizeof(data));
    76		}
    77	}
    78	

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

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c b/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
index cd85520d36e2..47c1cd704915 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
@@ -66,10 +66,9 @@  static void dcs_set_backlight(const struct drm_connector_state *conn_state, u32
 {
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(conn_state->best_encoder));
 	struct mipi_dsi_device *dsi_device;
-	u8 data = level;
+	u16 data = cpu_to_be16(level);
 	enum port port;
 
-	/* FIXME: Need to take care of 16 bit brightness level */
 	for_each_dsi_port(port, intel_dsi->dcs_backlight_ports) {
 		dsi_device = intel_dsi->dsi_hosts[port]->device;
 		mipi_dsi_dcs_write(dsi_device, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,