Skip to contentSkip to conversation

drm/tinydrm: Move mipi_dbi

PATCH Superseded Noralf Trønnes 4 participants 13 messages Jul 20, 2019 – Jul 24, 2019 1 message not in the archive

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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.

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 (6):
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: 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}    | 324 +++++++++---------
 drivers/gpu/drm/tinydrm/Kconfig               |  15 +-
 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, 682 insertions(+), 631 deletions(-)
 delete mode 100644 Documentation/gpu/tinydrm.rst
 rename drivers/gpu/drm/{tinydrm/mipi-dbi.c => drm_mipi_dbi.c} (78%)
 create mode 100644 include/drm/drm_mipi_dbi.h
 delete mode 100644 include/drm/tinydrm/mipi-dbi.h
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 1/6 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
index 42465228129c..37a73b4c0f85 100644
@@ -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
#2 lore raw

PATCH 2/6 drm/tinydrm: Rename variable mipi -> dbi

In reply to Noralf Trønnes

struct 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.

Cc Eric Anholt <[email protected]>
Cc David Lechner <[email protected]>
---
 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
index 7d2dfa92b661..f503d14aa36b 100644
@@ -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
index 393323f87e12..04b54ec61bc2 100644
@@ -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
#3 lore raw

PATCH 3/6 drm/tinydrm: Rename remaining variable mipi -> dbidev

In reply to Noralf Trønnes

struct 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.

Cc Eric Anholt <[email protected]>
Cc David Lechner <[email protected]>
---
 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
index f503d14aa36b..e113c434ff55 100644
@@ -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
index 05ba5ab17ec6..dfa8c6e952c8 100644
@@ -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
index adc8c4872d3f..9d284fb24c36 100644
@@ -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
index 8339e7dc5d92..cf0d7a26009c 100644
@@ -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
index 4309ae299766..5b23657659c6 100644
@@ -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
index 04b54ec61bc2..b7b301130af7 100644
@@ -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
#4 lore raw

PATCH 4/6 drm/tinydrm: Split struct mipi_dbi in two

In reply to Noralf Trønnes

Split 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*().

Cc Eric Anholt <[email protected]>
Cc David Lechner <[email protected]>
---
 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
index e113c434ff55..471e545154b3 100644
@@ -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
index 209a75dab7ce..33766fc21b2b 100644
@@ -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
index dfa8c6e952c8..71af275522a5 100644
@@ -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
index 9d284fb24c36..7925f69bc502 100644
@@ -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
index cf0d7a26009c..51871ee16ef6 100644
@@ -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
index 5b23657659c6..66275ef3a456 100644
@@ -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
#5 lore raw

PATCH 5/6 drm/tinydrm: Move mipi-dbi

In reply to 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 delete tinydrm.rst.
Delete the last tinydrm todo entry.

Cc Eric Anholt <[email protected]>
Cc David Lechner <[email protected]>
---
 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                | 15 ++++++---------
 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(+), 52 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
index 4bfb7068e9f7..b4a0ed3ca961 100644
@@ -11,7 +11,6 @@ GPU Driver Documentation
    meson
    pl111
    tegra
-   tinydrm
    tve200
    v3d
    vc4
Documentation/gpu/drm-kms-helpers.rst +12 -0
index b327bbc11182..3868008db8a9 100644
@@ -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
deleted file mode 100644
index 64bdf6356024..000000000000
@@ -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
index 688b4adbbf62..b81cc007acb8 100644
@@ -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
index b9362b4f6353..5e48b1496004 100644
@@ -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
+	bool
+	depends on DRM
+
 config DRM_MIPI_DSI
 	bool
 	depends on DRM
drivers/gpu/drm/Makefile +1 -0
index 9f0d2ee35794..dc894771d56c 100644
@@ -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
similarity index 99%
rename from drivers/gpu/drm/tinydrm/mipi-dbi.c
rename to drivers/gpu/drm/drm_mipi_dbi.c
index 1617784fef09..dd269389869a 100644
@@ -21,11 +21,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 -9
index 87819c82bcce..ec2c2fcc340a 100644
@@ -8,14 +8,11 @@ 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
-
 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 DRM_MIPI_DBI
 	help
 	  DRM driver for the following HX8357D panels:
 	  * YX350HV15-T 3.5" 340x350 TFT (Adafruit 3.5")
@@ -25,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 +33,7 @@ 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 DRM_MIPI_DBI
 	help
 	  DRM driver for the following Ilitek ILI9341 panels:
 	  * YX240QV29-T 2.4" 240x320 TFT (Adafruit 2.4")
@@ -47,7 +44,7 @@ config TINYDRM_MI0283QT
 	tristate "DRM support for MI0283QT"
 	depends on DRM_TINYDRM && SPI
 	depends on BACKLIGHT_CLASS_DEVICE
-	select TINYDRM_MIPI_DBI
+	select DRM_MIPI_DBI
 	help
 	  DRM driver for the Multi-Inno MI0283QT display panel
 	  If M is selected the module will be called mi0283qt.
@@ -68,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 +76,7 @@ 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 DRM_MIPI_DBI
 	help
 	  DRM driver Sitronix ST7735R with one of the following LCDs:
 	  * JD-T18003-T01 1.8" 128x160 TFT
drivers/gpu/drm/tinydrm/Makefile +0 -4
index ab6b9bebf321..6490167a9ad1 100644
@@ -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
index 471e545154b3..9af8ff84974f 100644
@@ -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
index 33766fc21b2b..c66acc566c2b 100644
@@ -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
index 71af275522a5..33b51dc7faa8 100644
@@ -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
index 7925f69bc502..e2cfd9a17143 100644
@@ -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
index 51871ee16ef6..3cc21a1b30c8 100644
@@ -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
index 66275ef3a456..3f4487c71684 100644
@@ -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
similarity index 100%
rename from include/drm/tinydrm/mipi-dbi.h
rename to include/drm/drm_mipi_dbi.h
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

PATCH 6/6 MAINTAINERS: Remove tinydrm entry

In reply to Noralf Trønnes

tinydrm 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
index 0a76716874bd..bff69ee0f1f7 100644
@@ -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
Reviewed-by on the v1 series
#7 lore raw
In reply to Noralf Trønnes

Hi Noralf.

Good to see a long journey end with a very nice result. I only entered the DRM world for the last parts of the journey, but nevertheless impressed by all the nice refactoring done.

Quoted 16 lines · Noralf Trønnes

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.

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.

Quoted 7 lines

Noralf Trønnes (6):
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: Move mipi-dbi
MAINTAINERS: Remove tinydrm entry

I have read all patches - looks good.
In "Split struct mipi_dbi in two" the documentation for the struct members is moved inside the struct - this makes it more readbale and is good.
This could have been an independent patch, or at least mentioned in the changelog.

You can for all patches add:

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

Hi Sam,

Den 20.07.2019 22.29, skrev Sam Ravnborg:

Quoted 6 lines

Hi Noralf.

Good to see a long journey end with a very nice result. I only entered the DRM world for the last parts of the journey, but nevertheless impressed by all the nice refactoring done.

Thanks, it's taken a while, but now it's quite easy to write small DRM drivers.

Quoted 32 lines · Noralf Trønnes
Quoted 16 lines

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.

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.

Quoted 7 lines

Noralf Trønnes (6):
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: Move mipi-dbi
MAINTAINERS: Remove tinydrm entry

I have read all patches - looks good.
In "Split struct mipi_dbi in two" the documentation for the struct members is moved inside the struct - this makes it more readbale and is good.
This could have been an independent patch, or at least mentioned in the changelog.

Quoted 3 lines

You can for all patches add:

The kbuild test robot alerted told me about some missing dependency so I'm spinning a new version.

Thanks for the review Sam!

Noralf.

Quoted 2 lines

Sam

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on the v1 series
#9 lore raw
In reply to Noralf Trønnes
Quoted 8 lines · Noralf Trønnes

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.

Quoted 5 lines

Note:
This depends on series: drm/tinydrm: Remove tinydrm.ko

Series is also available here:
https://github.com/notro/linux/tree/move_mipi_dbi

Congratulations on making it to this stage. This looks like a fine conclusion to tinydrm.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

Den 22.07.2019 20.06, skrev Eric Anholt:

Quoted 10 lines
Quoted 8 lines · Noralf Trønnes

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.

Quoted 9 lines
Quoted 5 lines

Note:
This depends on series: drm/tinydrm: Remove tinydrm.ko

Series is also available here:
https://github.com/notro/linux/tree/move_mipi_dbi

Congratulations on making it to this stage. This looks like a fine conclusion to tinydrm.

Thanks, it took a while, but really nice to finally get here.

There are only two patches left to do now, one to remove the menuconfig so the drivers are visible by default and people can start putting their tiny drivers here, and secondly to change the folder name to 'tiny' as Daniel wants it.

Quoted 2 lines

Thanks, care to take a look at version 2 of the series? I had to add 3 patches to deal with a kconfig dependency that I had missed out on.

Noralf.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw

Den 23.07.2019 09.10, skrev Daniel Vetter:

Quoted 17 lines · Eric Anholt
Quoted 16 lines
Quoted 13 lines · Noralf Trønnes

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.

Note:
This depends on series: drm/tinydrm: Remove tinydrm.ko

Series is also available here:
https://github.com/notro/linux/tree/move_mipi_dbi

Quoted 7 lines
Quoted 4 lines

Congratulations on making it to this stage. This looks like a fine conclusion to tinydrm.

Yeah let me heap on the congrats too, this has ben a long but really impressive journey to watch!

Looking back it's suprising to me that I continued to work on this. After Linus took a dump on tinydrm I wasn't much interested in doing any further work on Linux, there are lots of other interesting projects to work on. Then you cc'ed me on a patch telling me that someone was using the simple display helper I made, and before I knew it I was knee deep in refactoring work.

One big take away for me has been how much better my code becomes after going through a review process. Some times, looking back, I wonder - did I actually write that nice piece of code? And the real answer I guess is that I did the typing and often had the idea, but many times the fleshed out solution was not something that I came up with.

Noralf.

Quoted 2 lines

-Daniel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw
Quoted 26 lines · Noralf Trønnes

Den 23.07.2019 09.10, skrev Daniel Vetter:

Quoted 17 lines · Eric Anholt
Quoted 16 lines
Quoted 13 lines · Noralf Trønnes

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.

Note:
This depends on series: drm/tinydrm: Remove tinydrm.ko

Series is also available here:
https://github.com/notro/linux/tree/move_mipi_dbi

Quoted 7 lines
Quoted 4 lines

Congratulations on making it to this stage. This looks like a fine conclusion to tinydrm.

Yeah let me heap on the congrats too, this has ben a long but really impressive journey to watch!

Quoted 6 lines

Looking back it's suprising to me that I continued to work on this. After Linus took a dump on tinydrm I wasn't much interested in doing any further work on Linux, there are lots of other interesting projects to work on. Then you cc'ed me on a patch telling me that someone was using the simple display helper I made, and before I knew it I was knee deep in refactoring work.

Historical aside: That dump from Linus was one of the reasons we finally decided to enact a code of conduct and enforce it against everyone. We just can't afford to lose great people just because some big guns have a hard time controlling their temper. Aside from it's just nicer to work together with some respect.

Quoted 5 lines

One big take away for me has been how much better my code becomes after going through a review process. Some times, looking back, I wonder - did I actually write that nice piece of code? And the real answer I guess is that I did the typing and often had the idea, but many times the fleshed out solution was not something that I came up with.

For me great review (both for as reviewer and as author) is when everyone learns something. Personally I definitely learned a lot from all the small driver work that's been going on the past few years - completely different world compared to drivers mearsured in 100kloc units :-)

Cheers, Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel