Skip to contentSkip to conversation

drm/bridge: add it6505 driver

PATCH Superseded allen 3 participants 5 messages Oct 14, 2021 – Jan 5, 2022

Subsystems (4)

v10 of 11 Superseded Latest is v11 →

lore
Share & tools
lore

allen

author
#0 lore raw

PATCH v10 1/1 drm/bridge: add it6505 driver

This adds support for the iTE IT6505.
This device can convert DPI signal to DP output.

From: Allen Chen <[email protected]>

---
This patch depends on https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/

---
 drivers/gpu/drm/bridge/Kconfig      |    8 +
 drivers/gpu/drm/bridge/Makefile     |    1 +
 drivers/gpu/drm/bridge/ite-it6505.c | 3335 +++++++++++++++++++++++++++
 3 files changed, 3344 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/ite-it6505.c
drivers/gpu/drm/bridge/Kconfig +8 -0
index 431b6e12a81fe..e1afe171075f5 100644
@@ -74,6 +74,14 @@ config DRM_DISPLAY_CONNECTOR
 	  on ARM-based platforms. Saying Y here when this driver is not needed
 	  will not cause any issue.
 
+config DRM_ITE_IT6505
+        tristate "ITE IT6505 DisplayPort bridge"
+        depends on OF
+        select DRM_KMS_HELPER
+        select EXTCON
+        help
+          ITE IT6505 DisplayPort bridge chip driver.
+
 config DRM_LONTIUM_LT8912B
 	tristate "Lontium LT8912B DSI/HDMI bridge"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
index f2c73683cfcb7..425844c304953 100644
@@ -4,6 +4,7 @@ obj-$(CONFIG_DRM_CHIPONE_ICN6211) += chipone-icn6211.o
 obj-$(CONFIG_DRM_CHRONTEL_CH7033) += chrontel-ch7033.o
 obj-$(CONFIG_DRM_CROS_EC_ANX7688) += cros-ec-anx7688.o
 obj-$(CONFIG_DRM_DISPLAY_CONNECTOR) += display-connector.o
+obj-$(CONFIG_DRM_ITE_IT6505) += ite-it6505.o
 obj-$(CONFIG_DRM_LONTIUM_LT8912B) += lontium-lt8912b.o
 obj-$(CONFIG_DRM_LONTIUM_LT9611) += lontium-lt9611.o
 obj-$(CONFIG_DRM_LONTIUM_LT9611UXC) += lontium-lt9611uxc.o
drivers/gpu/drm/bridge/ite-it6505.c new file +3335 -0

2,979 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.1

Part of the diff is not shown here. View the raw message.

#1 lore raw
I love your patch! Perhaps something to improve:

Hi allen,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.15-rc5 next-20211013]
[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/allen/drm-bridge-add-it6505-driver/20211014-113315
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 348949d9a4440abdab3b1dc99a9bb660e8c7da7c
config: x86_64-randconfig-r013-20211014 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6c76d0101193aa4eb891a6954ff047eda2f9cf71)

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/b7059f22f5a66e301596957d9c6321d64358d6f0
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review allen/drm-bridge-add-it6505-driver/20211014-113315 git checkout b7059f22f5a66e301596957d9c6321d64358d6f0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

drivers/gpu/drm/bridge/ite-it6505.c:2919:15: error: implicit declaration of function 'drm_bridge_new_crtc_state' [-Werror,-Wimplicit-function-declaration]

           crtc_state = drm_bridge_new_crtc_state(bridge, old_state);
                        ^
   drivers/gpu/drm/bridge/ite-it6505.c:2919:15: note: did you mean 'drm_atomic_get_new_crtc_state'?
   include/drm/drm_atomic.h:553:1: note: 'drm_atomic_get_new_crtc_state' declared here
   drm_atomic_get_new_crtc_state(struct drm_atomic_state *state,
   ^
>> drivers/gpu/drm/bridge/ite-it6505.c:2919:13: warning: incompatible integer to pointer conversion assigning to 'const struct drm_crtc_state *' from 'int' [-Wint-conversion]
           crtc_state = drm_bridge_new_crtc_state(bridge, old_state);
                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 warning and 1 error generated.

vim +2919 drivers/gpu/drm/bridge/ite-it6505.c

2901
2902 static void it6505_bridge_atomic_enable(struct drm_bridge *bridge,
2903 struct drm_bridge_state *old_state)
2904 {
2905 struct it6505 *it6505 = bridge_to_it6505(bridge);
2906 struct device *dev = &it6505->client->dev;
2907 struct drm_atomic_state *state = old_state->base.state;
2908 struct hdmi_avi_infoframe frame;
2909 const struct drm_crtc_state *crtc_state;
2910 const struct drm_display_mode *mode;
2911 struct drm_connector *connector;
2912 int ret;
2913
2914 DRM_DEV_DEBUG_DRIVER(dev, "start");
2915
2916 connector = drm_atomic_get_new_connector_for_encoder(state,
2917 bridge->encoder);
2918

> 2919		crtc_state = drm_bridge_new_crtc_state(bridge, old_state);

2920 mode = &crtc_state->mode;
2921 ret = drm_hdmi_avi_infoframe_from_display_mode(&frame,
2922 connector,
2923 mode);
2924 if (ret)
2925 dev_err(dev, "Failed to setup AVI infoframe: %d", ret);
2926
2927 it6505_update_video_parameter(it6505, mode);
2928
2929 ret = it6505_send_video_infoframe(it6505, &frame);
2930
2931 if (ret)
2932 dev_err(dev, "Failed to send AVI infoframe: %d", ret);
2933
2934 it6505_int_mask_enable(it6505);
2935 it6505_video_reset(it6505);
2936 }
2937

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

#2 lore raw
In reply to allen
I love your patch! Yet something to improve:

Hi allen,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.15-rc5 next-20211013]
[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/allen/drm-bridge-add-it6505-driver/20211014-113315
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 348949d9a4440abdab3b1dc99a9bb660e8c7da7c
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 11.2.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/b7059f22f5a66e301596957d9c6321d64358d6f0
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review allen/drm-bridge-add-it6505-driver/20211014-113315 git checkout b7059f22f5a66e301596957d9c6321d64358d6f0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nios2

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

drivers/gpu/drm/bridge/ite-it6505.c: In function 'it6505_bridge_atomic_enable':

>> drivers/gpu/drm/bridge/ite-it6505.c:2919:22: error: implicit declaration of function 'drm_bridge_new_crtc_state'; did you mean 'drm_atomic_get_new_crtc_state'? [-Werror=implicit-function-declaration]
    2919 |         crtc_state = drm_bridge_new_crtc_state(bridge, old_state);
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~~
         |                      drm_atomic_get_new_crtc_state
>> drivers/gpu/drm/bridge/ite-it6505.c:2919:20: error: assignment to 'const struct drm_crtc_state *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
    2919 |         crtc_state = drm_bridge_new_crtc_state(bridge, old_state);
         |                    ^

cc1: all warnings being treated as errors

vim +2919 drivers/gpu/drm/bridge/ite-it6505.c

2901
2902 static void it6505_bridge_atomic_enable(struct drm_bridge *bridge,
2903 struct drm_bridge_state *old_state)
2904 {
2905 struct it6505 *it6505 = bridge_to_it6505(bridge);
2906 struct device *dev = &it6505->client->dev;
2907 struct drm_atomic_state *state = old_state->base.state;
2908 struct hdmi_avi_infoframe frame;
2909 const struct drm_crtc_state *crtc_state;
2910 const struct drm_display_mode *mode;
2911 struct drm_connector *connector;
2912 int ret;
2913
2914 DRM_DEV_DEBUG_DRIVER(dev, "start");
2915
2916 connector = drm_atomic_get_new_connector_for_encoder(state,
2917 bridge->encoder);
2918

> 2919		crtc_state = drm_bridge_new_crtc_state(bridge, old_state);

2920 mode = &crtc_state->mode;
2921 ret = drm_hdmi_avi_infoframe_from_display_mode(&frame,
2922 connector,
2923 mode);
2924 if (ret)
2925 dev_err(dev, "Failed to setup AVI infoframe: %d", ret);
2926
2927 it6505_update_video_parameter(it6505, mode);
2928
2929 ret = it6505_send_video_infoframe(it6505, &frame);
2930
2931 if (ret)
2932 dev_err(dev, "Failed to send AVI infoframe: %d", ret);
2933
2934 it6505_int_mask_enable(it6505);
2935 it6505_video_reset(it6505);
2936 }
2937

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

#3 lore raw
In reply to allen
I love your patch! Yet something to improve:

Hi allen,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.15-rc5 next-20211013]
[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/allen/drm-bridge-add-it6505-driver/20211014-113315
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 348949d9a4440abdab3b1dc99a9bb660e8c7da7c
config: microblaze-randconfig-r015-20211014 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 11.2.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/b7059f22f5a66e301596957d9c6321d64358d6f0
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review allen/drm-bridge-add-it6505-driver/20211014-113315 git checkout b7059f22f5a66e301596957d9c6321d64358d6f0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze

If you fix the issue, kindly add following tag as appropriate

All error/warnings (new ones prefixed by >>):

drivers/gpu/drm/bridge/ite-it6505.c: In function 'it6505_bridge_atomic_enable':

>> drivers/gpu/drm/bridge/ite-it6505.c:2919:22: error: implicit declaration of function 'drm_bridge_new_crtc_state'; did you mean 'drm_atomic_get_new_crtc_state'? [-Werror=implicit-function-declaration]
    2919 |         crtc_state = drm_bridge_new_crtc_state(bridge, old_state);
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~~
         |                      drm_atomic_get_new_crtc_state
>> drivers/gpu/drm/bridge/ite-it6505.c:2919:20: warning: assignment to 'const struct drm_crtc_state *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    2919 |         crtc_state = drm_bridge_new_crtc_state(bridge, old_state);
         |                    ^

cc1: some warnings being treated as errors

vim +2919 drivers/gpu/drm/bridge/ite-it6505.c

2901
2902 static void it6505_bridge_atomic_enable(struct drm_bridge *bridge,
2903 struct drm_bridge_state *old_state)
2904 {
2905 struct it6505 *it6505 = bridge_to_it6505(bridge);
2906 struct device *dev = &it6505->client->dev;
2907 struct drm_atomic_state *state = old_state->base.state;
2908 struct hdmi_avi_infoframe frame;
2909 const struct drm_crtc_state *crtc_state;
2910 const struct drm_display_mode *mode;
2911 struct drm_connector *connector;
2912 int ret;
2913
2914 DRM_DEV_DEBUG_DRIVER(dev, "start");
2915
2916 connector = drm_atomic_get_new_connector_for_encoder(state,
2917 bridge->encoder);
2918

> 2919		crtc_state = drm_bridge_new_crtc_state(bridge, old_state);

2920 mode = &crtc_state->mode;
2921 ret = drm_hdmi_avi_infoframe_from_display_mode(&frame,
2922 connector,
2923 mode);
2924 if (ret)
2925 dev_err(dev, "Failed to setup AVI infoframe: %d", ret);
2926
2927 it6505_update_video_parameter(it6505, mode);
2928
2929 ret = it6505_send_video_infoframe(it6505, &frame);
2930
2931 if (ret)
2932 dev_err(dev, "Failed to send AVI infoframe: %d", ret);
2933
2934 it6505_int_mask_enable(it6505);
2935 it6505_video_reset(it6505);
2936 }
2937

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

#4 lore raw
In reply to allen

Il 14/10/21 05:30, allen ha scritto:

Quoted 7 lines

This adds support for the iTE IT6505. This device can convert DPI signal to DP output.

From: Allen Chen <[email protected]>

Quoted 8 lines

---
This patch depends on https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/

---
  drivers/gpu/drm/bridge/Kconfig      |    8 +
  drivers/gpu/drm/bridge/Makefile     |    1 +
  drivers/gpu/drm/bridge/ite-it6505.c | 3335 +++++++++++++++++++++++++++
  3 files changed, 3344 insertions(+)

create mode 100644 drivers/gpu/drm/bridge/ite-it6505.c

Hello Allen,

since the dependency that you mentioned seems to be requiring some time to get merged in, can you please open-code the call to drm_bridge_new_crtc_state() as to stop requiring the commit you pointed to?

We can perhaps update this driver later, whenever the series you mentioned will get applied.

The reason for this request is due to a breakage on MT8183 Kukui: since DPI is supported in the drm-mediatek driver for this SoC, on platforms that are using a DSI<->DP/eDP bridge, a probe failure occurs for the DPI0 component. Leaving apart that drm-mediatek should be fixed to account for this as a non critical error (and keep going with DSI only, simply ignoring DPI0), the Kukui family of devices do have this functionality and it should be brought up as soon as possible at this point - especially since the driver that you've sent is ok to have.

Looking forward to see a v11 without unsatisfiable dependencies!

Thank you.

Regards,
- Angelo