drm/tinydrm: Move mipi_dbi
Subsystems (3)
v2 cover drm/tinydrm: Move mipi_dbi
This series ticks off the last tinydrm todo entry and moves out mipi_dbi to be a core helper.
It splits struct mipi_dbi into an interface part and a display pipeline part (upload framebuffer over SPI). I also took the opportunity to rename the ambiguous 'mipi' variable name to 'dbi'. This lines up with the use of the 'dsi' variable name in the MIPI DSI helper.
Changes since v1:
The kbuild test robot alerted me to the fact that I was missing a dependency on DRM_MIPI_DBI. I also realised that it had a dependency on the CMA helper as well.
The CMA helper dependency was resolved by open coding a function.
The KMS helper dependency revealed a problem with the BACKLIGHT dependency. Details in the patch.
I had mistakenly set DRM_MIPI_DBI to bool, this has been changed to tristate.
Note:
This depends on series: drm/tinydrm: Remove tinydrm.ko
Series is also available here:
https://github.com/notro/linux/tree/move_mipi_dbi
Noralf.
Noralf Trønnes (9):
drm/tinydrm/mipi-dbi: Move cmdlock mutex init drm/tinydrm: Rename variable mipi -> dbi drm/tinydrm: Rename remaining variable mipi -> dbidev drm/tinydrm: Split struct mipi_dbi in two drm/tinydrm/mipi-dbi: Remove CMA helper dependency drm/tinydrm/Kconfig: drivers: Select BACKLIGHT_CLASS_DEVICE drm/tinydrm/mipi-dbi: Select DRM_KMS_HELPER drm/tinydrm: Move mipi-dbi
MAINTAINERS: Remove tinydrm entry
Documentation/gpu/drivers.rst | 1 -
Documentation/gpu/drm-kms-helpers.rst | 12 +
Documentation/gpu/tinydrm.rst | 18 -
Documentation/gpu/todo.rst | 13 -
MAINTAINERS | 13 +-
drivers/gpu/drm/Kconfig | 4 +
drivers/gpu/drm/Makefile | 1 +
.../{tinydrm/mipi-dbi.c => drm_mipi_dbi.c} | 333 +++++++++---------
drivers/gpu/drm/tinydrm/Kconfig | 23 +-
drivers/gpu/drm/tinydrm/Makefile | 4 -
drivers/gpu/drm/tinydrm/hx8357d.c | 61 ++--
drivers/gpu/drm/tinydrm/ili9225.c | 171 ++++-----
drivers/gpu/drm/tinydrm/ili9341.c | 83 ++---
drivers/gpu/drm/tinydrm/mi0283qt.c | 89 ++---
drivers/gpu/drm/tinydrm/st7586.c | 104 +++---
drivers/gpu/drm/tinydrm/st7735r.c | 77 ++--
include/drm/drm_mipi_dbi.h | 188 ++++++++++
include/drm/tinydrm/mipi-dbi.h | 135 -------
18 files changed, 691 insertions(+), 639 deletions(-)
delete mode 100644 Documentation/gpu/tinydrm.rst
rename drivers/gpu/drm/{tinydrm/mipi-dbi.c => drm_mipi_dbi.c} (77%)
create mode 100644 include/drm/drm_mipi_dbi.h
delete mode 100644 include/drm/tinydrm/mipi-dbi.hSignature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 1/9 drm/tinydrm/mipi-dbi: Move cmdlock mutex init
cmdlock protects command execution so put it in mipi_dbi_spi_init() where it conceptually belongs.
This is prep work for the splitting of struct mipi_dbi.
--- drivers/gpu/drm/tinydrm/mipi-dbi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tinydrm/mipi-dbi.c +2 -2
@@ -506,8 +506,6 @@ int mipi_dbi_init_with_formats(struct mipi_dbi *mipi,if (!mipi->command)return -EINVAL ; -mutex_init (&mipi->cmdlock); - mipi->tx_buf =devm_kmalloc (drm->dev, tx_buf_size,GFP_KERNEL );if (!mipi->tx_buf)return -ENOMEM ;
@@ -1120,6 +1118,8 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi,return -ENOMEM ; } +mutex_init (&mipi->cmdlock); +DRM_DEBUG_DRIVER ("SPI speed: %uMHz\n" , spi->max_speed_hz /1000000 );return 0 ;
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 2/9 drm/tinydrm: Rename variable mipi -> dbi
In reply to Noralf Trønnesstruct mipi_dbi is going to be split into an interface part and a display pipeline part. The interface part can be used by drivers that need to initialize the controller, but that won't upload the framebuffer over this interface.
tinydrm uses the variable name 'mipi' but this is not a good name since MIPI refers to a lot of standards. This patch changes the variable name to 'dbi' where it refers to the interface part of struct mipi_dbi.
Functions that use both future parts will have both variables temporarily pointing to the same structure.
--- drivers/gpu/drm/tinydrm/hx8357d.c | 31 +++--- drivers/gpu/drm/tinydrm/ili9225.c | 135 +++++++++++++------------ drivers/gpu/drm/tinydrm/ili9341.c | 55 ++++++----- drivers/gpu/drm/tinydrm/mi0283qt.c | 55 ++++++----- drivers/gpu/drm/tinydrm/mipi-dbi.c | 153 +++++++++++++++-------------- drivers/gpu/drm/tinydrm/st7586.c | 62 ++++++------ drivers/gpu/drm/tinydrm/st7735r.c | 49 ++++----- include/drm/tinydrm/mipi-dbi.h | 20 ++-- 8 files changed, 291 insertions(+), 269 deletions(-)
drivers/gpu/drm/tinydrm/hx8357d.c +16 -15
@@ -48,6 +48,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe, struct drm_plane_state *plane_state) {struct mipi_dbi *mipi =drm_to_mipi_dbi (pipe->crtc.dev); +struct mipi_dbi *dbi = mipi;u8 addr_mode;int ret, idx;
@@ -63,22 +64,22 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe, goto out_enable;/* setextc */ -mipi_dbi_command (mipi,HX8357D_SETEXTC ,0xFF ,0x83 ,0x57 ); +mipi_dbi_command (dbi,HX8357D_SETEXTC ,0xFF ,0x83 ,0x57 );msleep (150 );/* setRGB which also enables SDO */ -mipi_dbi_command (mipi,HX8357D_SETRGB ,0x00 ,0x00 ,0x06 ,0x06 ); +mipi_dbi_command (dbi,HX8357D_SETRGB ,0x00 ,0x00 ,0x06 ,0x06 );/* -1.52V */ -mipi_dbi_command (mipi,HX8357D_SETCOM ,0x25 ); +mipi_dbi_command (dbi,HX8357D_SETCOM ,0x25 );/* Normal mode 70Hz, Idle mode 55 Hz */ -mipi_dbi_command (mipi,HX8357D_SETOSC ,0x68 ); +mipi_dbi_command (dbi,HX8357D_SETOSC ,0x68 );/* Set Panel - BGR, Gate direction swapped */ -mipi_dbi_command (mipi,HX8357D_SETPANEL ,0x05 ); +mipi_dbi_command (dbi,HX8357D_SETPANEL ,0x05 ); - mipi_dbi_command(mipi, HX8357D_SETPOWER, + mipi_dbi_command(dbi, HX8357D_SETPOWER, 0x00, /* Not deep standby */ 0x15, /* BT */ 0x1C, /* VSPR */
@@ -86,7 +87,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,0x83 ,/* AP */ 0xAA); /* FS */ - mipi_dbi_command(mipi, HX8357D_SETSTBA, + mipi_dbi_command(dbi, HX8357D_SETSTBA, 0x50, /* OPON normal */ 0x50, /* OPON idle */ 0x01, /* STBA */
@@ -94,7 +95,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,0x1E ,/* STBA */ 0x08); /* GEN */ - mipi_dbi_command(mipi, HX8357D_SETCYC, + mipi_dbi_command(dbi, HX8357D_SETCYC, 0x02, /* NW 0x02 */ 0x40, /* RTN */ 0x00, /* DIV */
@@ -103,7 +104,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,0x0D ,/* GDON */ 0x78); /* GDOFF */ - mipi_dbi_command(mipi, HX8357D_SETGAMMA, + mipi_dbi_command(dbi, HX8357D_SETGAMMA, 0x02, 0x0A, 0x11,
@@ -140,21 +141,21 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe, 0x01);/* 16 bit */ -mipi_dbi_command (mipi,MIPI_DCS_SET_PIXEL_FORMAT , +mipi_dbi_command (dbi,MIPI_DCS_SET_PIXEL_FORMAT ,MIPI_DCS_PIXEL_FMT_16BIT );/* TE off */ -mipi_dbi_command (mipi,MIPI_DCS_SET_TEAR_ON ,0x00 ); +mipi_dbi_command (dbi,MIPI_DCS_SET_TEAR_ON ,0x00 );/* tear line */ -mipi_dbi_command (mipi,MIPI_DCS_SET_TEAR_SCANLINE ,0x00 ,0x02 ); +mipi_dbi_command (dbi,MIPI_DCS_SET_TEAR_SCANLINE ,0x00 ,0x02 );/* Exit Sleep */ -mipi_dbi_command (mipi,MIPI_DCS_EXIT_SLEEP_MODE ); +mipi_dbi_command (dbi,MIPI_DCS_EXIT_SLEEP_MODE );msleep (150 );/* display on */ -mipi_dbi_command (mipi,MIPI_DCS_SET_DISPLAY_ON ); +mipi_dbi_command (dbi,MIPI_DCS_SET_DISPLAY_ON );usleep_range (5000 ,7000 ); out_enable:
@@ -172,7 +173,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe, addr_mode =HX8357D_MADCTL_MV |HX8357D_MADCTL_MX ;break ; } -mipi_dbi_command (mipi,MIPI_DCS_SET_ADDRESS_MODE , addr_mode); +mipi_dbi_command (dbi,MIPI_DCS_SET_ADDRESS_MODE , addr_mode);mipi_dbi_enable_flush (mipi, crtc_state, plane_state); out_exit:drm_dev_exit (idx);
drivers/gpu/drm/tinydrm/ili9225.c +70 -65
264 lines not on this page · raw message
drivers/gpu/drm/tinydrm/ili9341.c +29 -26
118 lines not on this page · raw message
drivers/gpu/drm/tinydrm/mi0283qt.c +29 -26
118 lines not on this page · raw message
drivers/gpu/drm/tinydrm/mipi-dbi.c +78 -75
417 lines not on this page · raw message
drivers/gpu/drm/tinydrm/st7586.c +33 -29
148 lines not on this page · raw message
drivers/gpu/drm/tinydrm/st7735r.c +26 -23
107 lines not on this page · raw message
include/drm/tinydrm/mipi-dbi.h +10 -10
@@ -59,7 +59,7 @@ struct mipi_dbi {struct spi_device *spi;bool enabled;struct mutex cmdlock; -int (*command)(struct mipi_dbi *mipi,u8 *cmd,u8 *param,size_t num); +int (*command)(struct mipi_dbi *dbi,u8 *cmd,u8 *param,size_t num);const u8 *read_commands;struct gpio_desc *dc;u16 *tx_buf;
@@ -77,7 +77,7 @@ static inline struct mipi_dbi *drm_to_mipi_dbi(struct drm_device *drm) return container_of(drm, struct mipi_dbi, drm); } -int mipi_dbi_spi_init (struct spi_device *spi,struct mipi_dbi *mipi, +int mipi_dbi_spi_init (struct spi_device *spi,struct mipi_dbi *dbi,struct gpio_desc *dc); int mipi_dbi_init_with_formats(struct mipi_dbi *mipi, const struct drm_simple_display_pipe_funcs *funcs,
@@ -94,8 +94,8 @@ void mipi_dbi_enable_flush(struct mipi_dbi *mipi,struct drm_crtc_state *crtc_state, struct drm_plane_state *plan_state);void mipi_dbi_pipe_disable (struct drm_simple_display_pipe *pipe); -void mipi_dbi_hw_reset (struct mipi_dbi *mipi); -bool mipi_dbi_display_is_on (struct mipi_dbi *mipi); +void mipi_dbi_hw_reset (struct mipi_dbi *dbi); +bool mipi_dbi_display_is_on (struct mipi_dbi *dbi);int mipi_dbi_poweron_reset (struct mipi_dbi *mipi);int mipi_dbi_poweron_conditional_reset (struct mipi_dbi *mipi);
@@ -103,14 +103,14 @@ u32 mipi_dbi_spi_cmd_max_speed(struct spi_device *spi, size_t len);int mipi_dbi_spi_transfer (struct spi_device *spi,u32 speed_hz,u8 bpw,const void *buf,size_t len); -int mipi_dbi_command_read (struct mipi_dbi *mipi,u8 cmd,u8 *val); -int mipi_dbi_command_buf (struct mipi_dbi *mipi,u8 cmd,u8 *data,size_t len); -int mipi_dbi_command_stackbuf (struct mipi_dbi *mipi,u8 cmd,u8 *data,size_t len); +int mipi_dbi_command_read (struct mipi_dbi *dbi,u8 cmd,u8 *val); +int mipi_dbi_command_buf (struct mipi_dbi *dbi,u8 cmd,u8 *data,size_t len); +int mipi_dbi_command_stackbuf (struct mipi_dbi *dbi,u8 cmd,u8 *data,size_t len);int mipi_dbi_buf_copy (void *dst,struct drm_framebuffer *fb,struct drm_rect *clip,bool swap);/** * mipi_dbi_command - MIPI DCS command with optional parameter(s) -* @mipi: MIPI structure +* @dbi: MIPI DBI structure * @cmd: Command * @seq...: Optional parameter(s) *
@@ -120,10 +120,10 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,* Returns: * Zero on success, negative error code on failure. */ -#define mipi_dbi_command(mipi, cmd, seq...) \ +#define mipi_dbi_command(dbi, cmd, seq...) \ ({ \ u8 d[] = { seq }; \ - mipi_dbi_command_stackbuf(mipi, cmd, d, ARRAY_SIZE(d)); \ + mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \ })#ifdef CONFIG_DEBUG_FS
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 2/9] drm/tinydrm: Rename variable mipi -> dbi
Quoted 9 lines · Noralf Trønnes
struct
mipi_dbiis going to be split into an interface part and a display pipeline part. The interface part can be used by drivers that need to initialize the controller, but that won't upload the framebuffer over this interface.tinydrm uses the variable name 'mipi' but this is not a good name since MIPI refers to a lot of standards. This patch changes the variable name to 'dbi' where it refers to the interface part of struct
mipi_dbi.
Quoted 8 lines
Functions that use both future parts will have both variables temporarily pointing to the same structure.
Cc Eric Anholt <[email protected]>Cc David Lechner <[email protected]>Reviewed-by Sam Ravnborg <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>---
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 3/9 drm/tinydrm: Rename remaining variable mipi -> dbidev
In reply to Noralf Trønnesstruct mipi_dbi is going to be split into an interface part and a display pipeline part. The interface part can be used by drivers that need to initialize the controller, but that won't upload the framebuffer over this interface.
tinydrm uses the variable name 'mipi' but this is not a good name since MIPI refers to a lot of standards. This patch changes the variable name to 'dbidev' where it refers to the pipeline part of struct mipi_dbi.
--- drivers/gpu/drm/tinydrm/hx8357d.c | 30 ++++---- drivers/gpu/drm/tinydrm/ili9225.c | 42 +++++----- drivers/gpu/drm/tinydrm/ili9341.c | 30 ++++---- drivers/gpu/drm/tinydrm/mi0283qt.c | 36 ++++----- drivers/gpu/drm/tinydrm/mipi-dbi.c | 120 ++++++++++++++--------------- drivers/gpu/drm/tinydrm/st7586.c | 34 ++++---- drivers/gpu/drm/tinydrm/st7735r.c | 30 ++++---- include/drm/tinydrm/mipi-dbi.h | 10 +-- 8 files changed, 166 insertions(+), 166 deletions(-)
drivers/gpu/drm/tinydrm/hx8357d.c +15 -15
@@ -47,8 +47,8 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *mipi = drm_to_mipi_dbi(pipe->crtc.dev); -struct mipi_dbi *dbi = mipi; + struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); +struct mipi_dbi *dbi = dbidev;u8 addr_mode;int ret, idx;
@@ -57,7 +57,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,DRM_DEBUG_KMS ("\n" ); - ret =mipi_dbi_poweron_conditional_reset (mipi); + ret =mipi_dbi_poweron_conditional_reset (dbidev);if (ret <0 ) goto out_exit;if (ret ==1 )
@@ -159,7 +159,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,usleep_range (5000 ,7000 ); out_enable: -switch (mipi->rotation) { +switch (dbidev->rotation) {default : addr_mode =HX8357D_MADCTL_MX |HX8357D_MADCTL_MY ;break ;
@@ -174,7 +174,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,break ; }mipi_dbi_command (dbi,MIPI_DCS_SET_ADDRESS_MODE , addr_mode); -mipi_dbi_enable_flush (mipi, crtc_state, plane_state); +mipi_dbi_enable_flush (dbidev, crtc_state, plane_state); out_exit:drm_dev_exit (idx); }
@@ -220,20 +220,20 @@ MODULE_DEVICE_TABLE(spi, hx8357d_id);static int hx8357d_probe (struct spi_device *spi) {struct device *dev = &spi->dev; +struct mipi_dbi *dbidev;struct drm_device *drm; -struct mipi_dbi *mipi;struct gpio_desc *dc;u32 rotation =0 ;int ret; - mipi =kzalloc (sizeof (*mipi),GFP_KERNEL ); -if (!mipi) + dbidev =kzalloc (sizeof (*dbidev),GFP_KERNEL ); +if (!dbidev)return -ENOMEM ; - drm = &mipi->drm; + drm = &dbidev->drm; ret =devm_drm_dev_init (dev, drm, &hx8357d_driver);if (ret) { -kfree (mipi); +kfree (dbidev);return ret; }
@@ -245,17 +245,17 @@ static int hx8357d_probe(struct spi_device *spi)return PTR_ERR (dc); } - mipi->backlight =devm_of_find_backlight (dev); -if (IS_ERR (mipi->backlight)) -return PTR_ERR (mipi->backlight); + dbidev->backlight =devm_of_find_backlight (dev); +if (IS_ERR (dbidev->backlight)) +return PTR_ERR (dbidev->backlight);device_property_read_u32 (dev,"rotation" , &rotation); - ret =mipi_dbi_spi_init (spi, mipi, dc); + ret =mipi_dbi_spi_init (spi, dbidev, dc);if (ret)return ret; - ret =mipi_dbi_init (mipi, &hx8357d_pipe_funcs, &yx350hv15_mode, rotation); + ret =mipi_dbi_init (dbidev, &hx8357d_pipe_funcs, &yx350hv15_mode, rotation);if (ret)return ret;
drivers/gpu/drm/tinydrm/ili9225.c +21 -21
128 lines not on this page · raw message
drivers/gpu/drm/tinydrm/ili9341.c +15 -15
@@ -53,8 +53,8 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *mipi = drm_to_mipi_dbi(pipe->crtc.dev); -struct mipi_dbi *dbi = mipi; + struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); +struct mipi_dbi *dbi = dbidev;u8 addr_mode;int ret, idx;
@@ -63,7 +63,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,DRM_DEBUG_KMS ("\n" ); - ret =mipi_dbi_poweron_conditional_reset (mipi); + ret =mipi_dbi_poweron_conditional_reset (dbidev);if (ret <0 ) goto out_exit;if (ret ==1 )
@@ -113,7 +113,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,msleep (100 ); out_enable: -switch (mipi->rotation) { +switch (dbidev->rotation) {default : addr_mode =ILI9341_MADCTL_MX ;break ;
@@ -130,7 +130,7 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe, } addr_mode |=ILI9341_MADCTL_BGR ;mipi_dbi_command (dbi,MIPI_DCS_SET_ADDRESS_MODE , addr_mode); -mipi_dbi_enable_flush (mipi, crtc_state, plane_state); +mipi_dbi_enable_flush (dbidev, crtc_state, plane_state); out_exit:drm_dev_exit (idx); }
@@ -176,22 +176,22 @@ MODULE_DEVICE_TABLE(spi, ili9341_id);static int ili9341_probe (struct spi_device *spi) {struct device *dev = &spi->dev; +struct mipi_dbi *dbidev;struct drm_device *drm; -struct mipi_dbi *mipi;struct mipi_dbi *dbi;struct gpio_desc *dc;u32 rotation =0 ;int ret; - mipi =kzalloc (sizeof (*mipi),GFP_KERNEL ); -if (!mipi) + dbidev =kzalloc (sizeof (*dbidev),GFP_KERNEL ); +if (!dbidev)return -ENOMEM ; - dbi = mipi; - drm = &mipi->drm; + dbi = dbidev; + drm = &dbidev->drm; ret =devm_drm_dev_init (dev, drm, &ili9341_driver);if (ret) { -kfree (mipi); +kfree (dbidev);return ret; }
@@ -209,9 +209,9 @@ static int ili9341_probe(struct spi_device *spi)return PTR_ERR (dc); } - mipi->backlight =devm_of_find_backlight (dev); -if (IS_ERR (mipi->backlight)) -return PTR_ERR (mipi->backlight); + dbidev->backlight =devm_of_find_backlight (dev); +if (IS_ERR (dbidev->backlight)) +return PTR_ERR (dbidev->backlight);device_property_read_u32 (dev,"rotation" , &rotation);
@@ -219,7 +219,7 @@ static int ili9341_probe(struct spi_device *spi)if (ret)return ret; - ret =mipi_dbi_init (mipi, &ili9341_pipe_funcs, &yx240qv29_mode, rotation); + ret =mipi_dbi_init (dbidev, &ili9341_pipe_funcs, &yx240qv29_mode, rotation);if (ret)return ret;
drivers/gpu/drm/tinydrm/mi0283qt.c +18 -18
@@ -51,8 +51,8 @@ static void mi0283qt_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *mipi = drm_to_mipi_dbi(pipe->crtc.dev); -struct mipi_dbi *dbi = mipi; + struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); +struct mipi_dbi *dbi = dbidev;u8 addr_mode;int ret, idx;
@@ -61,7 +61,7 @@ static void mi0283qt_enable(struct drm_simple_display_pipe *pipe,DRM_DEBUG_KMS ("\n" ); - ret =mipi_dbi_poweron_conditional_reset (mipi); + ret =mipi_dbi_poweron_conditional_reset (dbidev);if (ret <0 ) goto out_exit;if (ret ==1 )
@@ -117,7 +117,7 @@ static void mi0283qt_enable(struct drm_simple_display_pipe *pipe,* As a result, we need to always apply the rotation value * regardless of the display "on/off" state. */ -switch (mipi->rotation) { +switch (dbidev->rotation) {default : addr_mode =ILI9341_MADCTL_MV |ILI9341_MADCTL_MY |ILI9341_MADCTL_MX ;
@@ -134,7 +134,7 @@ static void mi0283qt_enable(struct drm_simple_display_pipe *pipe, } addr_mode |=ILI9341_MADCTL_BGR ;mipi_dbi_command (dbi,MIPI_DCS_SET_ADDRESS_MODE , addr_mode); -mipi_dbi_enable_flush (mipi, crtc_state, plane_state); +mipi_dbi_enable_flush (dbidev, crtc_state, plane_state); out_exit:drm_dev_exit (idx); }
@@ -180,22 +180,22 @@ MODULE_DEVICE_TABLE(spi, mi0283qt_id);static int mi0283qt_probe (struct spi_device *spi) {struct device *dev = &spi->dev; +struct mipi_dbi *dbidev;struct drm_device *drm; -struct mipi_dbi *mipi;struct mipi_dbi *dbi;struct gpio_desc *dc;u32 rotation =0 ;int ret; - mipi =kzalloc (sizeof (*mipi),GFP_KERNEL ); -if (!mipi) + dbidev =kzalloc (sizeof (*dbidev),GFP_KERNEL ); +if (!dbidev)return -ENOMEM ; - dbi = mipi; - drm = &mipi->drm; + dbi = dbidev; + drm = &dbidev->drm; ret =devm_drm_dev_init (dev, drm, &mi0283qt_driver);if (ret) { -kfree (mipi); +kfree (dbidev);return ret; }
@@ -213,13 +213,13 @@ static int mi0283qt_probe(struct spi_device *spi)return PTR_ERR (dc); } - mipi->regulator =devm_regulator_get (dev,"power" ); -if (IS_ERR (mipi->regulator)) -return PTR_ERR (mipi->regulator); + dbidev->regulator =devm_regulator_get (dev,"power" ); +if (IS_ERR (dbidev->regulator)) +return PTR_ERR (dbidev->regulator); - mipi->backlight =devm_of_find_backlight (dev); -if (IS_ERR (mipi->backlight)) -return PTR_ERR (mipi->backlight); + dbidev->backlight =devm_of_find_backlight (dev); +if (IS_ERR (dbidev->backlight)) +return PTR_ERR (dbidev->backlight);device_property_read_u32 (dev,"rotation" , &rotation);
@@ -227,7 +227,7 @@ static int mi0283qt_probe(struct spi_device *spi)if (ret)return ret; - ret =mipi_dbi_init (mipi, &mi0283qt_pipe_funcs, &mi0283qt_mode, rotation); + ret =mipi_dbi_init (dbidev, &mi0283qt_pipe_funcs, &mi0283qt_mode, rotation);if (ret)return ret;
drivers/gpu/drm/tinydrm/mipi-dbi.c +60 -60
297 lines not on this page · raw message
drivers/gpu/drm/tinydrm/st7586.c +17 -17
@@ -114,11 +114,11 @@ static int st7586_buf_copy(void *dst, struct drm_framebuffer *fb,static void st7586_fb_dirty (struct drm_framebuffer *fb,struct drm_rect *rect) { -struct mipi_dbi *mipi =drm_to_mipi_dbi (fb->dev); -struct mipi_dbi *dbi = mipi; +struct mipi_dbi *dbidev =drm_to_mipi_dbi (fb->dev); +struct mipi_dbi *dbi = dbidev;int start, end, idx, ret =0 ; -if (!mipi->enabled) +if (!dbidev->enabled)return ;if (!drm_dev_enter (fb->dev, &idx))
@@ -130,7 +130,7 @@ static void st7586_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)DRM_DEBUG_KMS ("Flushing [FB:%d] " DRM_RECT_FMT "\n" , fb->base.id,DRM_RECT_ARG (rect)); - ret =st7586_buf_copy (mipi->tx_buf, fb, rect); + ret =st7586_buf_copy (dbidev->tx_buf, fb, rect);if (ret) goto err_msg;
@@ -146,7 +146,7 @@ static void st7586_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect) (rect->y2 >> 8) & 0xFF, (rect->y2 - 1) & 0xFF); ret =mipi_dbi_command_buf (dbi,MIPI_DCS_WRITE_MEMORY_START , - (u8 *)mipi->tx_buf, + (u8 *)dbidev->tx_buf, (end - start) * (rect->y2 - rect->y1)); err_msg:if (ret)
@@ -177,9 +177,9 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *mipi = drm_to_mipi_dbi(pipe->crtc.dev); + struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev);struct drm_framebuffer *fb = plane_state->fb; -struct mipi_dbi *dbi = mipi; +struct mipi_dbi *dbi = dbidev; struct drm_rect rect = { .x1 = 0, .x2 = fb->width,
@@ -194,7 +194,7 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe,DRM_DEBUG_KMS ("\n" ); - ret =mipi_dbi_poweron_reset (mipi); + ret =mipi_dbi_poweron_reset (dbidev);if (ret) goto out_exit;
@@ -222,7 +222,7 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe,mipi_dbi_command (dbi,ST7586_DISP_MODE_GRAY );mipi_dbi_command (dbi,ST7586_ENABLE_DDRAM ,0x02 ); -switch (mipi->rotation) { +switch (dbidev->rotation) {default : addr_mode =0x00 ;break ;
@@ -245,7 +245,7 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe,msleep (100 ); - mipi->enabled = true; + dbidev->enabled = true;st7586_fb_dirty (fb, &rect);mipi_dbi_command (dbi,MIPI_DCS_SET_DISPLAY_ON );
@@ -318,23 +318,23 @@ MODULE_DEVICE_TABLE(spi, st7586_id);static int st7586_probe (struct spi_device *spi) {struct device *dev = &spi->dev; +struct mipi_dbi *dbidev;struct drm_device *drm; -struct mipi_dbi *mipi;struct mipi_dbi *dbi;struct gpio_desc *a0;u32 rotation =0 ;size_t bufsize;int ret; - mipi =kzalloc (sizeof (*mipi),GFP_KERNEL ); -if (!mipi) + dbidev =kzalloc (sizeof (*dbidev),GFP_KERNEL ); +if (!dbidev)return -ENOMEM ; - dbi = mipi; - drm = &mipi->drm; + dbi = dbidev; + drm = &dbidev->drm; ret =devm_drm_dev_init (dev, drm, &st7586_driver);if (ret) { -kfree (mipi); +kfree (dbidev);return ret; }
@@ -363,7 +363,7 @@ static int st7586_probe(struct spi_device *spi)/* Cannot read from this controller via SPI */ dbi->read_commands =NULL ; - ret =mipi_dbi_init_with_formats (mipi, &st7586_pipe_funcs, + ret =mipi_dbi_init_with_formats (dbidev, &st7586_pipe_funcs, st7586_formats,ARRAY_SIZE (st7586_formats), &st7586_mode, rotation, bufsize);if (ret)
drivers/gpu/drm/tinydrm/st7735r.c +15 -15
@@ -42,8 +42,8 @@ static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *mipi = drm_to_mipi_dbi(pipe->crtc.dev); -struct mipi_dbi *dbi = mipi; + struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); +struct mipi_dbi *dbi = dbidev;int ret, idx;u8 addr_mode;
@@ -52,7 +52,7 @@ static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe,DRM_DEBUG_KMS ("\n" ); - ret =mipi_dbi_poweron_reset (mipi); + ret =mipi_dbi_poweron_reset (dbidev);if (ret) goto out_exit;
@@ -73,7 +73,7 @@ static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe,mipi_dbi_command (dbi,ST7735R_PWCTR5 ,0x8a ,0xee );mipi_dbi_command (dbi,ST7735R_VMCTR1 ,0x0e );mipi_dbi_command (dbi,MIPI_DCS_EXIT_INVERT_MODE ); -switch (mipi->rotation) { +switch (dbidev->rotation) {default : addr_mode =ST7735R_MX |ST7735R_MY ;break ;
@@ -104,7 +104,7 @@ static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe,msleep (20 ); -mipi_dbi_enable_flush (mipi, crtc_state, plane_state); +mipi_dbi_enable_flush (dbidev, crtc_state, plane_state); out_exit:drm_dev_exit (idx); }
@@ -150,22 +150,22 @@ MODULE_DEVICE_TABLE(spi, st7735r_id);static int st7735r_probe (struct spi_device *spi) {struct device *dev = &spi->dev; +struct mipi_dbi *dbidev;struct drm_device *drm; -struct mipi_dbi *mipi;struct mipi_dbi *dbi;struct gpio_desc *dc;u32 rotation =0 ;int ret; - mipi =kzalloc (sizeof (*mipi),GFP_KERNEL ); -if (!mipi) + dbidev =kzalloc (sizeof (*dbidev),GFP_KERNEL ); +if (!dbidev)return -ENOMEM ; - dbi = mipi; - drm = &mipi->drm; + dbi = dbidev; + drm = &dbidev->drm; ret =devm_drm_dev_init (dev, drm, &st7735r_driver);if (ret) { -kfree (mipi); +kfree (dbidev);return ret; }
@@ -183,9 +183,9 @@ static int st7735r_probe(struct spi_device *spi)return PTR_ERR (dc); } - mipi->backlight =devm_of_find_backlight (dev); -if (IS_ERR (mipi->backlight)) -return PTR_ERR (mipi->backlight); + dbidev->backlight =devm_of_find_backlight (dev); +if (IS_ERR (dbidev->backlight)) +return PTR_ERR (dbidev->backlight);device_property_read_u32 (dev,"rotation" , &rotation);
@@ -196,7 +196,7 @@ static int st7735r_probe(struct spi_device *spi)/* Cannot read from Adafruit 1.8" display via SPI */ dbi->read_commands =NULL ; - ret =mipi_dbi_init (mipi, &jd_t18003_t01_pipe_funcs, &jd_t18003_t01_mode, rotation); + ret =mipi_dbi_init (dbidev, &jd_t18003_t01_pipe_funcs, &jd_t18003_t01_mode, rotation);if (ret)return ret;
include/drm/tinydrm/mipi-dbi.h +5 -5
@@ -79,25 +79,25 @@ static inline struct mipi_dbi *drm_to_mipi_dbi(struct drm_device *drm)int mipi_dbi_spi_init (struct spi_device *spi,struct mipi_dbi *dbi,struct gpio_desc *dc); -int mipi_dbi_init_with_formats (struct mipi_dbi *mipi, +int mipi_dbi_init_with_formats (struct mipi_dbi *dbidev,const struct drm_simple_display_pipe_funcs *funcs,const uint32_t *formats,unsigned int format_count,const struct drm_display_mode *mode,unsigned int rotation,size_t tx_buf_size); -int mipi_dbi_init (struct mipi_dbi *mipi, +int mipi_dbi_init (struct mipi_dbi *dbidev,const struct drm_simple_display_pipe_funcs *funcs,const struct drm_display_mode *mode,unsigned int rotation);void mipi_dbi_release (struct drm_device *drm);void mipi_dbi_pipe_update (struct drm_simple_display_pipe *pipe,struct drm_plane_state *old_state); -void mipi_dbi_enable_flush (struct mipi_dbi *mipi, +void mipi_dbi_enable_flush (struct mipi_dbi *dbidev,struct drm_crtc_state *crtc_state,struct drm_plane_state *plan_state);void mipi_dbi_pipe_disable (struct drm_simple_display_pipe *pipe);void mipi_dbi_hw_reset (struct mipi_dbi *dbi);bool mipi_dbi_display_is_on (struct mipi_dbi *dbi); -int mipi_dbi_poweron_reset (struct mipi_dbi *mipi); -int mipi_dbi_poweron_conditional_reset (struct mipi_dbi *mipi); +int mipi_dbi_poweron_reset (struct mipi_dbi *dbidev); +int mipi_dbi_poweron_conditional_reset (struct mipi_dbi *dbidev);u32 mipi_dbi_spi_cmd_max_speed (struct spi_device *spi,size_t len); int mipi_dbi_spi_transfer(struct spi_device *spi, u32 speed_hz,
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 3/9] drm/tinydrm: Rename remaining variable mipi -> dbidev
Quoted 9 lines · Noralf Trønnes
struct
mipi_dbiis going to be split into an interface part and a display pipeline part. The interface part can be used by drivers that need to initialize the controller, but that won't upload the framebuffer over this interface.tinydrm uses the variable name 'mipi' but this is not a good name since MIPI refers to a lot of standards. This patch changes the variable name to 'dbidev' where it refers to the pipeline part of struct
mipi_dbi.
Quoted 5 lines
Cc Eric Anholt <[email protected]>Cc David Lechner <[email protected]>Reviewed-by Sam Ravnborg <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>---
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 4/9 drm/tinydrm: Split struct mipi_dbi in two
In reply to Noralf TrønnesSplit struct mipi_dbi into an interface part and a display pipeline part. The interface part can be used by drivers that need to initialize the controller, but that won't upload the framebuffer over this interface.
MIPI DBI supports 3 interface types:
- A. Motorola 6800 type parallel bus
- B. Intel 8080 type parallel bus
- C. SPI type with 3 options:
I've embedded the SPI type specifics in the mipi_dbi struct to avoid adding unnecessary complexity. If more interface types will be supported in the future, the type specifics might have to be split out.
Rename functions to match the new struct mipi_dbi_dev:
- drm_to_mipi_dbi() -> drm_to_mipi_dbi_dev().
- mipi_dbi_init*() -> mipi_dbi_dev_init*().
--- drivers/gpu/drm/tinydrm/hx8357d.c | 10 +-- drivers/gpu/drm/tinydrm/ili9225.c | 18 ++-- drivers/gpu/drm/tinydrm/ili9341.c | 10 +-- drivers/gpu/drm/tinydrm/mi0283qt.c | 10 +-- drivers/gpu/drm/tinydrm/mipi-dbi.c | 83 ++++++++++--------- drivers/gpu/drm/tinydrm/st7586.c | 26 +++--- drivers/gpu/drm/tinydrm/st7735r.c | 10 +-- include/drm/tinydrm/mipi-dbi.h | 129 ++++++++++++++++++++--------- 8 files changed, 175 insertions(+), 121 deletions(-)
drivers/gpu/drm/tinydrm/hx8357d.c +5 -5
@@ -47,8 +47,8 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); -struct mipi_dbi *dbi = dbidev; + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); +struct mipi_dbi *dbi = &dbidev->dbi;u8 addr_mode;int ret, idx;
@@ -220,7 +220,7 @@ MODULE_DEVICE_TABLE(spi, hx8357d_id);static int hx8357d_probe (struct spi_device *spi) {struct device *dev = &spi->dev; -struct mipi_dbi *dbidev; +struct mipi_dbi_dev *dbidev;struct drm_device *drm;struct gpio_desc *dc;u32 rotation =0 ;
@@ -251,11 +251,11 @@ static int hx8357d_probe(struct spi_device *spi)device_property_read_u32 (dev,"rotation" , &rotation); - ret =mipi_dbi_spi_init (spi, dbidev, dc); + ret =mipi_dbi_spi_init (spi, &dbidev->dbi, dc);if (ret)return ret; - ret =mipi_dbi_init (dbidev, &hx8357d_pipe_funcs, &yx350hv15_mode, rotation); + ret =mipi_dbi_dev_init (dbidev, &hx8357d_pipe_funcs, &yx350hv15_mode, rotation);if (ret)return ret;
drivers/gpu/drm/tinydrm/ili9225.c +9 -9
@@ -78,10 +78,10 @@ static inline int ili9225_command(struct mipi_dbi *dbi, u8 cmd, u16 data)static void ili9225_fb_dirty (struct drm_framebuffer *fb,struct drm_rect *rect) {struct drm_gem_cma_object *cma_obj =drm_fb_cma_get_gem_obj (fb,0 ); -struct mipi_dbi *dbidev =drm_to_mipi_dbi (fb->dev); +struct mipi_dbi_dev *dbidev =drm_to_mipi_dbi_dev (fb->dev);unsigned int height = rect->y2 - rect->y1;unsigned int width = rect->x2 - rect->x1; -struct mipi_dbi *dbi = dbidev; +struct mipi_dbi *dbi = &dbidev->dbi;bool swap = dbi->swap_bytes;u16 x_start, y_start;u16 x1, x2, y1, y2;
@@ -183,10 +183,10 @@ static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev);struct drm_framebuffer *fb = plane_state->fb;struct device *dev = pipe->crtc.dev->dev; -struct mipi_dbi *dbi = dbidev; +struct mipi_dbi *dbi = &dbidev->dbi; struct drm_rect rect = { .x1 = 0, .x2 = fb->width,
@@ -291,8 +291,8 @@ static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe,static void ili9225_pipe_disable (struct drm_simple_display_pipe *pipe) { -struct mipi_dbi *dbidev =drm_to_mipi_dbi (pipe->crtc.dev); -struct mipi_dbi *dbi = dbidev; +struct mipi_dbi_dev *dbidev =drm_to_mipi_dbi_dev (pipe->crtc.dev); +struct mipi_dbi *dbi = &dbidev->dbi;DRM_DEBUG_KMS ("\n" );
@@ -378,7 +378,7 @@ MODULE_DEVICE_TABLE(spi, ili9225_id);static int ili9225_probe (struct spi_device *spi) {struct device *dev = &spi->dev; -struct mipi_dbi *dbidev; +struct mipi_dbi_dev *dbidev;struct drm_device *drm;struct mipi_dbi *dbi;struct gpio_desc *rs;
@@ -389,7 +389,7 @@ static int ili9225_probe(struct spi_device *spi)if (!dbidev)return -ENOMEM ; - dbi = dbidev; + dbi = &dbidev->dbi; drm = &dbidev->drm; ret =devm_drm_dev_init (dev, drm, &ili9225_driver);if (ret) {
@@ -420,7 +420,7 @@ static int ili9225_probe(struct spi_device *spi)/* override the command function set in mipi_dbi_spi_init() */ dbi->command = ili9225_dbi_command; - ret =mipi_dbi_init (dbidev, &ili9225_pipe_funcs, &ili9225_mode, rotation); + ret =mipi_dbi_dev_init (dbidev, &ili9225_pipe_funcs, &ili9225_mode, rotation);if (ret)return ret;
drivers/gpu/drm/tinydrm/ili9341.c +5 -5
@@ -53,8 +53,8 @@ static void yx240qv29_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); -struct mipi_dbi *dbi = dbidev; + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); +struct mipi_dbi *dbi = &dbidev->dbi;u8 addr_mode;int ret, idx;
@@ -176,7 +176,7 @@ MODULE_DEVICE_TABLE(spi, ili9341_id);static int ili9341_probe (struct spi_device *spi) {struct device *dev = &spi->dev; -struct mipi_dbi *dbidev; +struct mipi_dbi_dev *dbidev;struct drm_device *drm;struct mipi_dbi *dbi;struct gpio_desc *dc;
@@ -187,7 +187,7 @@ static int ili9341_probe(struct spi_device *spi)if (!dbidev)return -ENOMEM ; - dbi = dbidev; + dbi = &dbidev->dbi; drm = &dbidev->drm; ret =devm_drm_dev_init (dev, drm, &ili9341_driver);if (ret) {
@@ -219,7 +219,7 @@ static int ili9341_probe(struct spi_device *spi)if (ret)return ret; - ret =mipi_dbi_init (dbidev, &ili9341_pipe_funcs, &yx240qv29_mode, rotation); + ret =mipi_dbi_dev_init (dbidev, &ili9341_pipe_funcs, &yx240qv29_mode, rotation);if (ret)return ret;
drivers/gpu/drm/tinydrm/mi0283qt.c +5 -5
@@ -51,8 +51,8 @@ static void mi0283qt_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); -struct mipi_dbi *dbi = dbidev; + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); +struct mipi_dbi *dbi = &dbidev->dbi;u8 addr_mode;int ret, idx;
@@ -180,7 +180,7 @@ MODULE_DEVICE_TABLE(spi, mi0283qt_id);static int mi0283qt_probe (struct spi_device *spi) {struct device *dev = &spi->dev; -struct mipi_dbi *dbidev; +struct mipi_dbi_dev *dbidev;struct drm_device *drm;struct mipi_dbi *dbi;struct gpio_desc *dc;
@@ -191,7 +191,7 @@ static int mi0283qt_probe(struct spi_device *spi)if (!dbidev)return -ENOMEM ; - dbi = dbidev; + dbi = &dbidev->dbi; drm = &dbidev->drm; ret =devm_drm_dev_init (dev, drm, &mi0283qt_driver);if (ret) {
@@ -227,7 +227,7 @@ static int mi0283qt_probe(struct spi_device *spi)if (ret)return ret; - ret =mipi_dbi_init (dbidev, &mi0283qt_pipe_funcs, &mi0283qt_mode, rotation); + ret =mipi_dbi_dev_init (dbidev, &mi0283qt_pipe_funcs, &mi0283qt_mode, rotation);if (ret)return ret;
drivers/gpu/drm/tinydrm/mipi-dbi.c +42 -41
246 lines not on this page · raw message
drivers/gpu/drm/tinydrm/st7586.c +13 -13
@@ -114,8 +114,8 @@ static int st7586_buf_copy(void *dst, struct drm_framebuffer *fb,static void st7586_fb_dirty (struct drm_framebuffer *fb,struct drm_rect *rect) { -struct mipi_dbi *dbidev =drm_to_mipi_dbi (fb->dev); -struct mipi_dbi *dbi = dbidev; +struct mipi_dbi_dev *dbidev =drm_to_mipi_dbi_dev (fb->dev); +struct mipi_dbi *dbi = &dbidev->dbi;int start, end, idx, ret =0 ;if (!dbidev->enabled)
@@ -177,9 +177,9 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev);struct drm_framebuffer *fb = plane_state->fb; -struct mipi_dbi *dbi = dbidev; +struct mipi_dbi *dbi = &dbidev->dbi; struct drm_rect rect = { .x1 = 0, .x2 = fb->width,
@@ -255,7 +255,7 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe,static void st7586_pipe_disable (struct drm_simple_display_pipe *pipe) { -struct mipi_dbi *mipi =drm_to_mipi_dbi (pipe->crtc.dev); +struct mipi_dbi_dev *dbidev =drm_to_mipi_dbi_dev (pipe->crtc.dev);/* * This callback is not protected by drm_dev_enter/exit since we want to
@@ -266,11 +266,11 @@ static void st7586_pipe_disable(struct drm_simple_display_pipe *pipe)DRM_DEBUG_KMS ("\n" ); -if (!mipi->enabled) +if (!dbidev->enabled)return ; -mipi_dbi_command (mipi,MIPI_DCS_SET_DISPLAY_OFF ); - mipi->enabled = false; +mipi_dbi_command (&dbidev->dbi,MIPI_DCS_SET_DISPLAY_OFF ); + dbidev->enabled = false; }static const u32 st7586_formats[] = {
@@ -318,7 +318,7 @@ MODULE_DEVICE_TABLE(spi, st7586_id);static int st7586_probe (struct spi_device *spi) {struct device *dev = &spi->dev; -struct mipi_dbi *dbidev; +struct mipi_dbi_dev *dbidev;struct drm_device *drm;struct mipi_dbi *dbi;struct gpio_desc *a0;
@@ -330,7 +330,7 @@ static int st7586_probe(struct spi_device *spi)if (!dbidev)return -ENOMEM ; - dbi = dbidev; + dbi = &dbidev->dbi; drm = &dbidev->drm; ret =devm_drm_dev_init (dev, drm, &st7586_driver);if (ret) {
@@ -363,9 +363,9 @@ static int st7586_probe(struct spi_device *spi)/* Cannot read from this controller via SPI */ dbi->read_commands =NULL ; - ret =mipi_dbi_init_with_formats (dbidev, &st7586_pipe_funcs, - st7586_formats,ARRAY_SIZE (st7586_formats), - &st7586_mode, rotation, bufsize); + ret =mipi_dbi_dev_init_with_formats (dbidev, &st7586_pipe_funcs, + st7586_formats,ARRAY_SIZE (st7586_formats), + &st7586_mode, rotation, bufsize);if (ret)return ret;
drivers/gpu/drm/tinydrm/st7735r.c +5 -5
@@ -42,8 +42,8 @@ static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe,struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi *dbidev = drm_to_mipi_dbi(pipe->crtc.dev); -struct mipi_dbi *dbi = dbidev; + struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); +struct mipi_dbi *dbi = &dbidev->dbi;int ret, idx;u8 addr_mode;
@@ -150,7 +150,7 @@ MODULE_DEVICE_TABLE(spi, st7735r_id);static int st7735r_probe (struct spi_device *spi) {struct device *dev = &spi->dev; -struct mipi_dbi *dbidev; +struct mipi_dbi_dev *dbidev;struct drm_device *drm;struct mipi_dbi *dbi;struct gpio_desc *dc;
@@ -161,7 +161,7 @@ static int st7735r_probe(struct spi_device *spi)if (!dbidev)return -ENOMEM ; - dbi = dbidev; + dbi = &dbidev->dbi; drm = &dbidev->drm; ret =devm_drm_dev_init (dev, drm, &st7735r_driver);if (ret) {
@@ -196,7 +196,7 @@ static int st7735r_probe(struct spi_device *spi)/* Cannot read from Adafruit 1.8" display via SPI */ dbi->read_commands =NULL ; - ret =mipi_dbi_init (dbidev, &jd_t18003_t01_pipe_funcs, &jd_t18003_t01_mode, rotation); + ret =mipi_dbi_dev_init (dbidev, &jd_t18003_t01_pipe_funcs, &jd_t18003_t01_mode, rotation);if (ret)return ret;
include/drm/tinydrm/mipi-dbi.h +91 -38
163 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 4/9] drm/tinydrm: Split struct mipi_dbi in two
Quoted 17 lines · Noralf Trønnes
Split struct
mipi_dbiinto an interface part and a display pipeline part. The interface part can be used by drivers that need to initialize the controller, but that won't upload the framebuffer over this interface.MIPI DBI supports 3 interface types:
- A. Motorola 6800 type parallel bus
- B. Intel 8080 type parallel bus
- C. SPI type with 3 options:I've embedded the SPI type specifics in the
mipi_dbistruct to avoid adding unnecessary complexity. If more interface types will be supported in the future, the type specifics might have to be split out.Rename functions to match the new struct
mipi_dbi_dev:
-drm_to_mipi_dbi()->drm_to_mipi_dbi_dev().
- mipi_dbi_init*() -> mipi_dbi_dev_init*().
Quoted 5 lines
Cc Eric Anholt <[email protected]>Cc David Lechner <[email protected]>Reviewed-by Sam Ravnborg <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>---
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 5/9 drm/tinydrm/mipi-dbi: Remove CMA helper dependency
In reply to Noralf Trønnesmipi-dbi depends on the CMA helper through it's use of drm_fb_cma_get_gem_obj(). This is an unnecessary dependency to drag in for drivers that only want to use the MIPI DBI interface part. Avoid this by open coding the function.
--- drivers/gpu/drm/tinydrm/mipi-dbi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/tinydrm/mipi-dbi.c +5 -4
@@ -16,7 +16,6 @@#include <drm/drm_connector.h> #include <drm/drm_damage_helper.h> #include <drm/drm_drv.h> -#include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_format_helper.h> #include <drm/drm_fourcc.h>
@@ -201,8 +200,9 @@ EXPORT_SYMBOL(mipi_dbi_command_stackbuf);int mipi_dbi_buf_copy (void *dst,struct drm_framebuffer *fb,struct drm_rect *clip,bool swap) { -struct drm_gem_cma_object *cma_obj =drm_fb_cma_get_gem_obj (fb,0 ); -struct dma_buf_attachment *import_attach = cma_obj->base.import_attach; +struct drm_gem_object *gem =drm_gem_fb_get_obj (fb,0 ); +struct drm_gem_cma_object *cma_obj =to_drm_gem_cma_obj (gem); +struct dma_buf_attachment *import_attach = gem->import_attach;struct drm_format_name_buf format_name;void *src = cma_obj->vaddr;int ret =0 ;
@@ -240,7 +240,8 @@ EXPORT_SYMBOL(mipi_dbi_buf_copy);static void mipi_dbi_fb_dirty (struct drm_framebuffer *fb,struct drm_rect *rect) { -struct drm_gem_cma_object *cma_obj =drm_fb_cma_get_gem_obj (fb,0 ); +struct drm_gem_object *gem =drm_gem_fb_get_obj (fb,0 ); +struct drm_gem_cma_object *cma_obj =to_drm_gem_cma_obj (gem);struct mipi_dbi_dev *dbidev =drm_to_mipi_dbi_dev (fb->dev);unsigned int height = rect->y2 - rect->y1;unsigned int width = rect->x2 - rect->x1;
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 5/9] drm/tinydrm/mipi-dbi: Remove CMA helper dependency
Quoted 7 lines · Noralf Trønnes
mipi-dbi depends on the CMA helper through it's use of
drm_fb_cma_get_gem_obj(). This is an unnecessary dependency to drag in for drivers that only want to use the MIPI DBI interface part. Avoid this by open coding the function.Signed-off-by Noralf Trønnes <[email protected]>---
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 6/9 drm/tinydrm/Kconfig: drivers: Select BACKLIGHT_CLASS_DEVICE
In reply to Noralf TrønnesThe mipi_dbi helper is missing a dependency on DRM_KMS_HELPER and putting that in revealed this problem:
drivers/video/fbdev/Kconfig:12:error: recursive dependency detected! drivers/video/fbdev/Kconfig:12: symbol FB is selected by DRM_KMS_FB_HELPERdrivers/gpu/drm/Kconfig:75: symbol DRM_KMS_FB_HELPER depends on DRM_KMS_HELPERdrivers/gpu/drm/Kconfig:69: symbol DRM_KMS_HELPER is selected by TINYDRM_MIPI_DBI
drivers/gpu/drm/tinydrm/Kconfig:11: symbol TINYDRM_MIPI_DBI is selected by TINYDRM_HX8357D drivers/gpu/drm/tinydrm/Kconfig:15: symbol TINYDRM_HX8357D depends on BACKLIGHT_CLASS_DEVICE drivers/video/backlight/Kconfig:144: symbol BACKLIGHT_CLASS_DEVICE is selected by FB_BACKLIGHT drivers/video/fbdev/Kconfig:187: symbol FB_BACKLIGHT depends on FB
A symbol that selects DRM_KMS_HELPER can not depend on BACKLIGHT_CLASS_DEVICE. The reason for this is that DRM_KMS_FB_HELPER selects FB instead of depending on it.
The tinydrm drivers have somehow gotten away with depending on BACKLIGHT_CLASS_DEVICE because DRM_TINYDRM selects DRM_KMS_HELPER and the drivers depend on that symbol.
An audit shows that all DRM drivers that select DRM_KMS_HELPER and use BACKLIGHT_CLASS_DEVICE, selects it:
DRM_TILCDC, DRM_GMA500, DRM_SHMOBILE, DRM_NOUVEAU, DRM_FSL_DCU, DRM_I915, DRM_RADEON, DRM_AMDGPU, DRM_PARADE_PS8622
Documentation/kbuild/kconfig-language.txt has a note regarding select:
1. 'select should be used with care since it doesn't visit dependencies.' This is not a problem since BACKLIGHT_CLASS_DEVICE doesn't have any dependencies.
2. 'In general use select only for non-visible symbols' BACKLIGHT_CLASS_DEVICE is user visible.
The real solution to this would be to have DRM_KMS_FB_HELPER depend on the user visible symbol FB. That is a can of worms I'm not willing to tackle. I fear that such a change will result in me handling difficult fallouts for the next weeks. So I'm following DRM suite here.
--- drivers/gpu/drm/tinydrm/Kconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/tinydrm/Kconfig +4 -4
@@ -14,8 +14,8 @@ config TINYDRM_MIPI_DBI config TINYDRM_HX8357D tristate "DRM support for HX8357D display panels" depends on DRM_TINYDRM && SPI - depends on BACKLIGHT_CLASS_DEVICE select TINYDRM_MIPI_DBI + select BACKLIGHT_CLASS_DEVICE help DRM driver for the following HX8357D panels: * YX350HV15-T 3.5" 340x350 TFT (Adafruit 3.5")
@@ -35,8 +35,8 @@ config TINYDRM_ILI9225 config TINYDRM_ILI9341 tristate "DRM support for ILI9341 display panels" depends on DRM_TINYDRM && SPI - depends on BACKLIGHT_CLASS_DEVICE select TINYDRM_MIPI_DBI + select BACKLIGHT_CLASS_DEVICE help DRM driver for the following Ilitek ILI9341 panels: * YX240QV29-T 2.4" 240x320 TFT (Adafruit 2.4")
@@ -46,8 +46,8 @@ config TINYDRM_ILI9341 config TINYDRM_MI0283QT tristate "DRM support for MI0283QT" depends on DRM_TINYDRM && SPI - depends on BACKLIGHT_CLASS_DEVICE select TINYDRM_MIPI_DBI + select BACKLIGHT_CLASS_DEVICE help DRM driver for the Multi-Inno MI0283QT display panel If M is selected the module will be called mi0283qt.
@@ -78,8 +78,8 @@ config TINYDRM_ST7586 config TINYDRM_ST7735R tristate "DRM support for Sitronix ST7735R display panels" depends on DRM_TINYDRM && SPI - depends on BACKLIGHT_CLASS_DEVICE select TINYDRM_MIPI_DBI + select BACKLIGHT_CLASS_DEVICE help DRM driver Sitronix ST7735R with one of the following LCDs: * JD-T18003-T01 1.8" 128x160 TFT
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 6/9] drm/tinydrm/Kconfig: drivers: Select BACKLIGHT_CLASS_DEVICE
Quoted 32 lines · Noralf Trønnes
The
mipi_dbihelper is missing a dependency onDRM_KMS_HELPERand putting that in revealed this problem:drivers/video/fbdev/Kconfig:12:error: recursive dependency detected!
drivers/video/fbdev/Kconfig:12: symbol FB is selected byDRM_KMS_FB_HELPERdrivers/gpu/drm/Kconfig:75: symbolDRM_KMS_FB_HELPERdepends onDRM_KMS_HELPERdrivers/gpu/drm/Kconfig:69: symbolDRM_KMS_HELPERis selected byTINYDRM_MIPI_DBIdrivers/gpu/drm/tinydrm/Kconfig:11: symbol TINYDRM_MIPI_DBI is selected by TINYDRM_HX8357D drivers/gpu/drm/tinydrm/Kconfig:15: symbol TINYDRM_HX8357D depends on BACKLIGHT_CLASS_DEVICE drivers/video/backlight/Kconfig:144: symbol BACKLIGHT_CLASS_DEVICE is selected by FB_BACKLIGHT drivers/video/fbdev/Kconfig:187: symbol FB_BACKLIGHT depends on FBA symbol that selects
DRM_KMS_HELPERcan not depend onBACKLIGHT_CLASS_DEVICE. The reason for this is thatDRM_KMS_FB_HELPERselects FB instead of depending on it.The tinydrm drivers have somehow gotten away with depending on
BACKLIGHT_CLASS_DEVICEbecauseDRM_TINYDRMselectsDRM_KMS_HELPERand the drivers depend on that symbol.An audit shows that all DRM drivers that select
DRM_KMS_HELPERand useBACKLIGHT_CLASS_DEVICE, selects it:
DRM_TILCDC,DRM_GMA500,DRM_SHMOBILE,DRM_NOUVEAU,DRM_FSL_DCU,DRM_I915,DRM_RADEON,DRM_AMDGPU,DRM_PARADE_PS8622
Documentation/kbuild/kconfig-language.txthas a note regarding select:
1. 'select should be used with care since it doesn't visit dependencies.' This is not a problem sinceBACKLIGHT_CLASS_DEVICEdoesn't have any dependencies.
2. 'In general use select only for non-visible symbols'BACKLIGHT_CLASS_DEVICEis user visible.
Quoted 7 lines
The real solution to this would be to have
DRM_KMS_FB_HELPERdepend on the user visible symbol FB. That is a can of worms I'm not willing to tackle. I fear that such a change will result in me handling difficult fallouts for the next weeks. So I'm following DRM suite here.Signed-off-by Noralf Trønnes <[email protected]>---
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 7/9 drm/tinydrm/mipi-dbi: Select DRM_KMS_HELPER
In reply to Noralf Trønnesmipi-dbi uses several KMS helper functions but that build dependency is not expressed. Select DRM_KMS_HELPER to fix that.
--- drivers/gpu/drm/tinydrm/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/tinydrm/Kconfig +1 -0
@@ -10,6 +10,7 @@ menuconfig DRM_TINYDRM config TINYDRM_MIPI_DBI tristate + select DRM_KMS_HELPER config TINYDRM_HX8357D tristate "DRM support for HX8357D display panels"
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 7/9] drm/tinydrm/mipi-dbi: Select DRM_KMS_HELPER
Quoted 6 lines · Noralf Trønnes
mipi-dbi uses several KMS helper functions but that build dependency is not expressed. Select
DRM_KMS_HELPERto fix that.Reported-by kbuild test robot <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>---
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 8/9 drm/tinydrm: Move mipi-dbi
In reply to Noralf TrønnesThis moves mipi-dbi to be a core helper with the name drm_mipi_dbi.
Fixup include's in drivers.
Move the docs entry and delete tinydrm.rst.
Delete the last tinydrm todo entry.
v2: Make DRM_MIPI_DBI tristate to enable it being built as a module.
---
Documentation/gpu/drivers.rst | 1 -
Documentation/gpu/drm-kms-helpers.rst | 12 ++++++++++++
Documentation/gpu/tinydrm.rst | 18 ------------------
Documentation/gpu/todo.rst | 13 -------------
drivers/gpu/drm/Kconfig | 4 ++++
drivers/gpu/drm/Makefile | 1 +
.../drm/{tinydrm/mipi-dbi.c => drm_mipi_dbi.c} | 2 +-
drivers/gpu/drm/tinydrm/Kconfig | 16 ++++++----------
drivers/gpu/drm/tinydrm/Makefile | 4 ----
drivers/gpu/drm/tinydrm/hx8357d.c | 2 +-
drivers/gpu/drm/tinydrm/ili9225.c | 2 +-
drivers/gpu/drm/tinydrm/ili9341.c | 2 +-
drivers/gpu/drm/tinydrm/mi0283qt.c | 2 +-
drivers/gpu/drm/tinydrm/st7586.c | 2 +-
drivers/gpu/drm/tinydrm/st7735r.c | 2 +-
.../drm/{tinydrm/mipi-dbi.h => drm_mipi_dbi.h} | 0
16 files changed, 30 insertions(+), 53 deletions(-)
delete mode 100644 Documentation/gpu/tinydrm.rst
rename drivers/gpu/drm/{tinydrm/mipi-dbi.c => drm_mipi_dbi.c} (99%)
rename include/drm/{tinydrm/mipi-dbi.h => drm_mipi_dbi.h} (100%)Documentation/gpu/drivers.rst +0 -1
@@ -11,7 +11,6 @@ GPU Driver Documentation meson pl111 tegra - tinydrm tve200 v3d vc4
Documentation/gpu/drm-kms-helpers.rst +12 -0
@@ -263,6 +263,18 @@ the MST topology helpers easier to understand drm_dp_mst_topology_put_port drm_dp_mst_get_mstb_malloc drm_dp_mst_put_mstb_malloc +MIPI DBI Helper Functions Reference +=================================== + +.. kernel-doc:: drivers/gpu/drm/drm_mipi_dbi.c + :doc: overview + +.. kernel-doc:: include/drm/drm_mipi_dbi.h + :internal: + +.. kernel-doc:: drivers/gpu/drm/drm_mipi_dbi.c + :export: + MIPI DSI Helper Functions Reference ===================================
Documentation/gpu/tinydrm.rst deleted +0 -18
@@ -1,18 +0,0 @@ -============================ -drm/tinydrm Tiny DRM drivers -============================ - -tinydrm is a collection of DRM drivers that are so small they can fit in a -single source file. - -MIPI DBI Compatible Controllers -=============================== - -.. kernel-doc:: drivers/gpu/drm/tinydrm/mipi-dbi.c - :doc: overview - -.. kernel-doc:: include/drm/tinydrm/mipi-dbi.h - :internal: - -.. kernel-doc:: drivers/gpu/drm/tinydrm/mipi-dbi.c - :export:
Documentation/gpu/todo.rst +0 -13
@@ -437,19 +437,6 @@ Contact: Daniel Vetter Driver Specific =============== -tinydrm -------- - -Tinydrm is the helper driver for really simple fb drivers. The goal is to make -those drivers as simple as possible, so lots of room for refactoring: - -- extract the mipi-dbi helper (well, the non-tinydrm specific parts at - least) into a separate helper, like we have for mipi-dsi already. Or follow - one of the ideas for having a shared dsi/dbi helper, abstracting away the - transport details more. - -Contact: Noralf Trønnes, Daniel Vetter - AMD DC Display Driver ---------------------
drivers/gpu/drm/Kconfig +4 -0
@@ -24,6 +24,10 @@ menuconfig DRM details. You should also select and configure AGP (/dev/agpgart) support if it is available for your platform. +config DRM_MIPI_DBI + tristate + depends on DRM + config DRM_MIPI_DSI bool depends on DRM
drivers/gpu/drm/Makefile +1 -0
@@ -55,6 +55,7 @@ obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o obj-$(CONFIG_DRM_DEBUG_SELFTEST) += selftests/ obj-$(CONFIG_DRM) += drm.o +obj-$(CONFIG_DRM_MIPI_DBI) += drm_mipi_dbi.o obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += drm_panel_orientation_quirks.o obj-y += arm/
drivers/gpu/drm/drm_mipi_dbi.c renamed from drivers/gpu/drm/tinydrm/mipi-dbi.c +1 -1
@@ -20,11 +20,11 @@#include <drm/drm_format_helper.h> #include <drm/drm_fourcc.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_mipi_dbi.h> #include <drm/drm_modes.h> #include <drm/drm_probe_helper.h> #include <drm/drm_rect.h> #include <drm/drm_vblank.h> -#include <drm/tinydrm/mipi-dbi.h> #include <video/mipi_display.h> #define MIPI_DBI_MAX_SPI_READ_SPEED 2000000/* 2MHz */
drivers/gpu/drm/tinydrm/Kconfig +6 -10
@@ -8,14 +8,10 @@ menuconfig DRM_TINYDRM Choose this option if you have a tinydrm supported display. If M is selected the module will be called tinydrm. -config TINYDRM_MIPI_DBI - tristate - select DRM_KMS_HELPER - config TINYDRM_HX8357D tristate "DRM support for HX8357D display panels" depends on DRM_TINYDRM && SPI - select TINYDRM_MIPI_DBI + select DRM_MIPI_DBI select BACKLIGHT_CLASS_DEVICE help DRM driver for the following HX8357D panels:
@@ -26,7 +22,7 @@ config TINYDRM_HX8357D config TINYDRM_ILI9225 tristate "DRM support for ILI9225 display panels" depends on DRM_TINYDRM && SPI - select TINYDRM_MIPI_DBI + select DRM_MIPI_DBI help DRM driver for the following Ilitek ILI9225 panels: * No-name 2.2" color screen module
@@ -36,7 +32,7 @@ config TINYDRM_ILI9225 config TINYDRM_ILI9341 tristate "DRM support for ILI9341 display panels" depends on DRM_TINYDRM && SPI - select TINYDRM_MIPI_DBI + select DRM_MIPI_DBI select BACKLIGHT_CLASS_DEVICE help DRM driver for the following Ilitek ILI9341 panels:
@@ -47,7 +43,7 @@ config TINYDRM_ILI9341 config TINYDRM_MI0283QT tristate "DRM support for MI0283QT" depends on DRM_TINYDRM && SPI - select TINYDRM_MIPI_DBI + select DRM_MIPI_DBI select BACKLIGHT_CLASS_DEVICE help DRM driver for the Multi-Inno MI0283QT display panel
@@ -69,7 +65,7 @@ config TINYDRM_REPAPER config TINYDRM_ST7586 tristate "DRM support for Sitronix ST7586 display panels" depends on DRM_TINYDRM && SPI - select TINYDRM_MIPI_DBI + select DRM_MIPI_DBI help DRM driver for the following Sitronix ST7586 panels: * LEGO MINDSTORMS EV3
@@ -79,7 +75,7 @@ config TINYDRM_ST7586 config TINYDRM_ST7735R tristate "DRM support for Sitronix ST7735R display panels" depends on DRM_TINYDRM && SPI - select TINYDRM_MIPI_DBI + select DRM_MIPI_DBI select BACKLIGHT_CLASS_DEVICE help DRM driver Sitronix ST7735R with one of the following LCDs:
drivers/gpu/drm/tinydrm/Makefile +0 -4
@@ -1,9 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -# Controllers -obj-$(CONFIG_TINYDRM_MIPI_DBI) += mipi-dbi.o - -# Displays obj-$(CONFIG_TINYDRM_HX8357D) += hx8357d.o obj-$(CONFIG_TINYDRM_ILI9225) += ili9225.o obj-$(CONFIG_TINYDRM_ILI9341) += ili9341.o
drivers/gpu/drm/tinydrm/hx8357d.c +1 -1
@@ -21,8 +21,8 @@#include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_mipi_dbi.h> #include <drm/drm_modeset_helper.h> -#include <drm/tinydrm/mipi-dbi.h> #include <video/mipi_display.h> #define HX8357D_SETOSC 0xb0
drivers/gpu/drm/tinydrm/ili9225.c +1 -1
@@ -24,9 +24,9 @@#include <drm/drm_fourcc.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_mipi_dbi.h> #include <drm/drm_rect.h> #include <drm/drm_vblank.h> -#include <drm/tinydrm/mipi-dbi.h> #define ILI9225_DRIVER_READ_CODE 0x00#define ILI9225_DRIVER_OUTPUT_CONTROL 0x01
drivers/gpu/drm/tinydrm/ili9341.c +1 -1
@@ -20,8 +20,8 @@#include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_mipi_dbi.h> #include <drm/drm_modeset_helper.h> -#include <drm/tinydrm/mipi-dbi.h> #include <video/mipi_display.h> #define ILI9341_FRMCTR1 0xb1
drivers/gpu/drm/tinydrm/mi0283qt.c +1 -1
@@ -18,8 +18,8 @@#include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_mipi_dbi.h> #include <drm/drm_modeset_helper.h> -#include <drm/tinydrm/mipi-dbi.h> #include <video/mipi_display.h> #define ILI9341_FRMCTR1 0xb1
drivers/gpu/drm/tinydrm/st7586.c +1 -1
@@ -21,9 +21,9 @@#include <drm/drm_format_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_mipi_dbi.h> #include <drm/drm_rect.h> #include <drm/drm_vblank.h> -#include <drm/tinydrm/mipi-dbi.h> /* controller-specific commands */ #define ST7586_DISP_MODE_GRAY 0x38
drivers/gpu/drm/tinydrm/st7735r.c +1 -1
@@ -19,7 +19,7 @@#include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> -#include <drm/tinydrm/mipi-dbi.h> +#include <drm/drm_mipi_dbi.h> #define ST7735R_FRMCTR1 0xb1#define ST7735R_FRMCTR2 0xb2
include/drm/drm_mipi_dbi.h renamed from include/drm/tinydrm/mipi-dbi.h +0 -0
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 8/9] drm/tinydrm: Move mipi-dbi
Quoted 6 lines · Noralf Trønnes
This moves mipi-dbi to be a core helper with the name
drm_mipi_dbi.Fixup include's in drivers.
Move the docs entry and deletetinydrm.rst. Delete the last tinydrm todo entry.
Quoted 7 lines
v2: Make
DRM_MIPI_DBItristate to enable it being built as a module.Cc Eric Anholt <[email protected]>Cc David Lechner <[email protected]>Reviewed-by Sam Ravnborg <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>---
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 9/9 MAINTAINERS: Remove tinydrm entry
In reply to Noralf Trønnestinydrm is just a collection of tiny drivers now. Add T: drm-misc entry for tinydrm drivers that lacks it.
--- MAINTAINERS | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
MAINTAINERS +5 -8
@@ -5017,6 +5017,7 @@ F: Documentation/devicetree/bindings/display/panel/feiyang,fy07024di26a30d.txt DRM DRIVER FOR ILITEK ILI9225 PANELS M: David Lechner <[email protected]> +T: git git://anongit.freedesktop.org/drm/drm-misc S: Maintained F: drivers/gpu/drm/tinydrm/ili9225.c F: Documentation/devicetree/bindings/display/ilitek,ili9225.txt
@@ -5045,6 +5046,7 @@ F: drivers/gpu/drm/mgag200/ DRM DRIVER FOR MI0283QT M: Noralf Trønnes <[email protected]> +T: git git://anongit.freedesktop.org/drm/drm-misc S: Maintained F: drivers/gpu/drm/tinydrm/mi0283qt.c F: Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt
@@ -5078,6 +5080,7 @@ F: Documentation/devicetree/bindings/display/panel/olimex,lcd-olinuxino.txt DRM DRIVER FOR PERVASIVE DISPLAYS REPAPER PANELS M: Noralf Trønnes <[email protected]> +T: git git://anongit.freedesktop.org/drm/drm-misc S: Maintained F: drivers/gpu/drm/tinydrm/repaper.c F: Documentation/devicetree/bindings/display/repaper.txt
@@ -5137,12 +5140,14 @@ F: Documentation/devicetree/bindings/display/panel/sitronix,st7701.txt DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner <[email protected]> +T: git git://anongit.freedesktop.org/drm/drm-misc S: Maintained F: drivers/gpu/drm/tinydrm/st7586.c F: Documentation/devicetree/bindings/display/sitronix,st7586.txt DRM DRIVER FOR SITRONIX ST7735R PANELS M: David Lechner <[email protected]> +T: git git://anongit.freedesktop.org/drm/drm-misc S: Maintained F: drivers/gpu/drm/tinydrm/st7735r.c F: Documentation/devicetree/bindings/display/sitronix,st7735r.txt
@@ -5452,14 +5457,6 @@ F: drivers/gpu/drm/panel/ F: include/drm/drm_panel.h F: Documentation/devicetree/bindings/display/panel/ -DRM TINYDRM DRIVERS -M: Noralf Trønnes <[email protected]> -W: https://github.com/notro/tinydrm/wiki/Development -T: git git://anongit.freedesktop.org/drm/drm-misc -S: Maintained -F: drivers/gpu/drm/tinydrm/ -F: include/drm/tinydrm/ - DRM DRIVERS FOR XEN M: Oleksandr Andrushchenko <[email protected]> T: git git://anongit.freedesktop.org/drm/drm-misc
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 9/9] MAINTAINERS: Remove tinydrm entry
Quoted 7 lines · Noralf Trønnes
tinydrm is just a collection of tiny drivers now. Add T: drm-misc entry for tinydrm drivers that lacks it.
Cc David Lechner <[email protected]>Reviewed-by Sam Ravnborg <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>---
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Den 22.07.2019 12.43, skrev Noralf Trønnes:
Quoted 29 lines
This series ticks off the last tinydrm todo entry and moves out
mipi_dbito be a core helper.It splits struct
mipi_dbiinto an interface part and a display pipeline part (upload framebuffer over SPI). I also took the opportunity to rename the ambiguous 'mipi' variable name to 'dbi'. This lines up with the use of the 'dsi' variable name in the MIPI DSI helper.Changes since v1:
The kbuild test robot alerted me to the fact that I was missing a dependency onDRM_MIPI_DBI. I also realised that it had a dependency on the CMA helper as well.The CMA helper dependency was resolved by open coding a function.
The KMS helper dependency revealed a problem with the BACKLIGHT dependency. Details in the patch.
I had mistakenly set
DRM_MIPI_DBIto bool, this has been changed to tristate.Note:
This depends on series: drm/tinydrm: Remove tinydrm.koSeries is also available here:
https://github.com/notro/linux/tree/move_mipi_dbiNoralf.
Quoted 11 lines
Noralf Trønnes (9):
drm/tinydrm/mipi-dbi: Move cmdlock mutex init drm/tinydrm: Rename variable mipi -> dbi drm/tinydrm: Rename remaining variable mipi -> dbidev drm/tinydrm: Split structmipi_dbiin two drm/tinydrm/mipi-dbi: Remove CMA helper dependency drm/tinydrm/Kconfig: drivers: SelectBACKLIGHT_CLASS_DEVICEdrm/tinydrm/mipi-dbi: SelectDRM_KMS_HELPERdrm/tinydrm: Move mipi-dbi
MAINTAINERS: Remove tinydrm entry
Series applied to drm-misc-next, thanks for reviewing!
Noralf.
Quoted 15 lines
Documentation/gpu/drivers.rst | 1 -
Documentation/gpu/drm-kms-helpers.rst | 12 +
Documentation/gpu/tinydrm.rst | 18 -
Documentation/gpu/todo.rst | 13 -
MAINTAINERS | 13 +-
drivers/gpu/drm/Kconfig | 4 +
drivers/gpu/drm/Makefile | 1 +
.../{tinydrm/mipi-dbi.c => drm_mipi_dbi.c} | 333 +++++++++---------
drivers/gpu/drm/tinydrm/Kconfig | 23 +-
drivers/gpu/drm/tinydrm/Makefile | 4 -
drivers/gpu/drm/tinydrm/hx8357d.c | 61 ++--
drivers/gpu/drm/tinydrm/ili9225.c | 171 ++++-----
drivers/gpu/drm/tinydrm/ili9341.c | 83 ++---
drivers/gpu/drm/tinydrm/mi0283qt.c | 89 ++---
drivers/gpu/drm/tinydrm/st7586.c | 104 +++---Quoted 9 lines
drivers/gpu/drm/tinydrm/st7735r.c | 77 ++--
include/drm/drm_mipi_dbi.h | 188 ++++++++++
include/drm/tinydrm/mipi-dbi.h | 135 -------
18 files changed, 691 insertions(+), 639 deletions(-)
delete mode 100644 Documentation/gpu/tinydrm.rst
rename drivers/gpu/drm/{tinydrm/mipi-dbi.c => drm_mipi_dbi.c} (77%)
create mode 100644 include/drm/drm_mipi_dbi.h
delete mode 100644 include/drm/tinydrm/mipi-dbi.h_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel