Replies: 1 comment 3 replies
-
|
panel-mipi-dbi is only for panels that support the MIPI DBI standard, it's not meant to go beyond that. This probably means a new driver. I'm not doing any kernel development for the time being, not sure if will return to it apart from the occasional patch, so it's best you ask on the mailinglist. But I don't think you should base your driver on drm_mipi_dbi, I think it's better to write a new one akin to drivers/gpu/drm/solomon. The drivers in tiny/ that use drm_mipi_dbi but are not MIPI DBI compatible, would most likely not have been accepted in that form today. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is more a discussions about the panel-mipi-dbi.c driver you made, hope it's ok to start the discussion here before posting to kernel mailing list.
I have come across a couple of small display with various driver IC:s that doesn't have any Linux driver and they are not exactly register compatible with the MIPI_DCS_SET_COLUMN_ADDRESS, MIPI_DCS_SET_PAGE_ADDRESS and MIPI_DCS_WRITE_MEMORY_START and MIPI_DCS_SOFT_RESET, which seems to be all that needs to be handled by the panel driver tweaks.
So the cmd registers are different and some uses only 1 byte per xs, xe ys, ye, some tiny LCD displays actually combine the xs into the cmd byte, and requires new cmd for each line.
In some cases the framebuffer data needs modification from rgb565 as well, some are 4 bit grayscale with 2 pixels/byte, some are monochrome with weird 3 pixels/byte as the st7586.c driver in the kernel. Others needs data sent in 8 rows/byte.
Would it be a good idea to extend the panel-mipi-dbi to handle these variants? Either by a new "variant" or similar attribute in the devicetree or a 3rd optional parameter in the "compatible" that select a built in variant.
Or perhaps additional fields in devicetree, e.g "set_column_cmd", "set_page_cmd" "byte_per_column" etc. as well as "frame-buffer-format" to make it truly generic.
The alternative would be to make another custom driver, but I really like to reuse the firmware support for init sequence as in panel-mipi-dbi. Should /could that code be moved to drm_mipi_dbi.c so more drivers could use it?
Example of code snippet to handle an ST75156 based display, the framebuffer conversion should be moved to a separate function I guess.
Do you think I should clean up and send a proper patch for panel-mipi-dbi or go for a new driver?
`
static int mipi_dbi_spi_command_st75156(struct mipi_dbi *dbi, u8 *cmd,
u8 parameters, size_t num)
{
/ Each byte of data is 8 vertical pixels, not horisontal. Max 256x160 */
struct mipi_dbi_dev *dbidev = container_of(dbi, struct mipi_dbi_dev, dbi);
struct panel_mipi_dbi_commands *priv = dbidev->driver_private;
int ret = 0;
}
static int mipi_dbi_spi_command(struct mipi_dbi *dbi, u8 *cmd,
u8 *parameters, size_t num)
{
//unsigned int bpw = (*cmd == MIPI_DCS_WRITE_MEMORY_START) ? 16 : 8;
int ret = 0;
struct mipi_dbi_dev *dbidev = container_of(dbi, struct mipi_dbi_dev, dbi);
struct panel_mipi_dbi_commands *priv = dbidev->driver_private;
}
@@ -203,8 +250,11 @@ static void panel_mipi_dbi_enable(struct drm_simple_display_pipe *pipe,
ret = mipi_dbi_poweron_conditional_reset(dbidev);
if (ret < 0)
goto out_exit;
- if (!ret)
+ if (!ret) {
+ dbi->command = priv->command;
panel_mipi_dbi_commands_execute(dbi, dbidev->driver_private);
+ dbi->command = mipi_dbi_spi_command;
+ }
@ -318,6 +862,10 @@ static int panel_mipi_dbi_spi_probe(struct spi_device *spi)
dbidev->driver_private = panel_mipi_dbi_commands_from_fw(dev);
if (IS_ERR(dbidev->driver_private))
return PTR_ERR(dbidev->driver_private);
+ commands = dbidev->driver_private;
+ commands->command = dbi->command;
+ dbi->command = mipi_dbi_spi_command;
`
Beta Was this translation helpful? Give feedback.
All reactions