Skip to content

Conversation

@KATE-WANG-NXP
Copy link
Contributor

@KATE-WANG-NXP KATE-WANG-NXP commented Nov 3, 2025

  1. Add user configuration of buffer address alignment and update area pitch's alignment for display driver sample.
  2. Add board specific configuration for mimxrt700_evk lvgl examples. The mimxrt700_evk uses DC8000 to drive all panels which requires a 64-byte align of buffer address and stride.
  3. Update CO5300 panel driver
    3.1 Fix wrong backlight pin in driver overlay
    3.2 Remove the power-on pin configuration in code and binding, and add mipi display panel regulator in panel overlay instead. Set 'regulator-boot-on' to true means the power-on pin will be enabled during system boot.
    3.3 Remove 'last_known_framebuffer' from panel data structure. It is not used anywhere
    3.4 Fix bug in 'co5300_set_pixel_format' function.
    3.5 Fix the issue that the panel does not support start coordinates and the width/height of the updated area being odd value.
    Solution: In panel driver, maintain a full screen-sized buffer, its address and pitch alignment is configurable in device tree and shall be compliant with the display controller's requirements. It can be placed in RAM or if the RAM space is not enough it can also be placed in other memory resion. When there is a frame update request, the updated area will be first filled to the buffer, if the area's size or coordinate is odd, adjust the value so the real updated area covers the requested updated area, then use this buffer to send pixel to panel, this can ensure the updated area's size and coordinate are always even.

@KATE-WANG-NXP KATE-WANG-NXP changed the title Update zc143ac72mipi co5300 display example Update zc143ac72mipi co5300 driver and display driver example Nov 3, 2025
* area is row 6~472 and line 0~466. So adjust coordinates accordingly.
*/
/* First two bytes are starting X coordinate */
start_xpos = x;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update the width and height of the panel in the shield overlay instead of adding this runtime calculations?

Copy link
Contributor Author

@KATE-WANG-NXP KATE-WANG-NXP Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, it is not the height and width, it is that to the co5300 controller the panel is 472x466 while actually the first 6 rows are cut off physically to make it a round panel, so if the higher app wants to update from 0,0, we need to pass 6,0 to the co5300 controller

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it zc143ac72 panel specific? If this controller is used by other panels, could this value be different?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zejiang0jason Yes the driver display_co5300 is used by zc143ac72 only

Copy link
Member

@uLipe uLipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have a question.

data->bytes_per_pixel = 2;
break;
case PIXEL_FORMAT_RGB_888:
data->pixel_format = MIPI_DSI_PIXFMT_RGB888;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm usually the pixel format is set to the data only after the command succeeded otherwise you get inconsistent state.

@kartben kartben assigned mmahadevan108 and dleach02 and unassigned kartben Nov 19, 2025
}

rect_w = ROUND_UP(rect_w, CONFIG_SAMPLE_PITCH_ALIGN);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest change:

size_t rect_pitch = ROUND_UP(rect_w, CONFIG_SAMPLE_PITCH_ALIGN);
size_t full_screen_pitch = ROUND_UP(capabilities.x_resolution, CONFIG_SAMPLE_PITCH_ALIGN);

buf_size = MAX(rect_pitch * rect_h, full_screen_pitch * h_step);

The variables rect_pitch and full_screen_pitch can be used later in buf_desc setting.

local_desc.width = ROUND_UP(local_desc.width, 2U);
local_desc.height = ROUND_UP(local_desc.height, 2U);
local_desc.width = desc->width + 1;
local_desc.height = desc->height + 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why assign the local_desc.width and local_desc.height again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, typo

* area is row 6~472 and line 0~466. So adjust coordinates accordingly.
*/
/* First two bytes are starting X coordinate */
start_xpos = x;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it zc143ac72 panel specific? If this controller is used by other panels, could this value be different?

local_desc.width = desc->width + 1;
local_desc.height = desc->height + 1;
local_desc.pitch = data->frame_pitch;
local_desc.frame_incomplete = desc->frame_incomplete;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we only send out whole dirty region, when the frame_incomplete is false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is what we do now in every update, the frame_incomplete param in the descriptor passed down from app level is needed and used by some of low level driver like lcdic or dbi_spi, we just preserve and pass down the param, it is not actually used.

while (tx_size > 0) {
msg.tx_len = tx_size;
msg.tx_buf = src;
bytes_written = (int)mipi_dsi_transfer(config->mipi_dsi, config->channel, &msg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tx_size is the whole data size, is the data to be sent continuous in memory? if not, can mipi_dsi_transfer support non-continuous data?

Copy link
Contributor Author

@KATE-WANG-NXP KATE-WANG-NXP Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it can if using lcdif

local_desc.height = desc->height + 1;
local_desc.pitch = data->frame_pitch;
local_desc.frame_incomplete = desc->frame_incomplete;
local_desc.buf_size = local_desc.width * local_desc.height * data->bytes_per_pixel;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if possible, suggest make this area adjustment as a static function, currently this function is very large.

@KATE-WANG-NXP KATE-WANG-NXP force-pushed the update-zc143ac72mipi-co5300-display-example branch from acb7e91 to 7b04e9a Compare November 24, 2025 03:46
@zephyrbot zephyrbot requested a review from faxe1008 November 24, 2025 03:48
Add user configuration of buffer address alignment and update area pitch
alignment.

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
The mimxrt700_evk uses DC8000 to drive panel which requires a 64
byte align of buffer address and stride.

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
@KATE-WANG-NXP KATE-WANG-NXP force-pushed the update-zc143ac72mipi-co5300-display-example branch 2 times, most recently from 97e0e5c to 9858111 Compare November 24, 2025 05:00
@KATE-WANG-NXP KATE-WANG-NXP force-pushed the update-zc143ac72mipi-co5300-display-example branch from 9858111 to 4daf132 Compare November 27, 2025 06:22
@KATE-WANG-NXP KATE-WANG-NXP force-pushed the update-zc143ac72mipi-co5300-display-example branch from 4daf132 to 64a23e4 Compare November 28, 2025 06:09
@zephyrbot zephyrbot requested a review from JarmouniA November 28, 2025 06:11
1. Fix wrong backlight pin in driver overlay
2. Remove the power-on pin configuration in code and binding, and
add mipi display panel regulator in panel overlay instead. Set
regulator-boot-on' to true means the power-on pin will be enabled
uring system boot.
3. Remove 'last_known_framebuffer' from panel data structure. It is
not used anywhere
4. Fix bug in 'co5300_set_pixel_format' function.
5. Fix the issue that the panel does not support start coordinates
   and the width/height of the updated area being odd value.
   Solution: In panel driver, maintain a full screen-sized buffer,
   its address and pitch alignment is configurable in device tree
   and shall be compliant with the display controller's requirements.
   It can be placed in RAM or if the RAM space is not enough it can
   also be placed in other memory resion. When there is a frame
   update request, the updated area will be first filled to the
   buffer, if the area's size or coordinate is odd, adjust the value
   so the real updated area covers the requested updated area, then
   use this buffer to send pixel to panel, this can ensure the
   updated area's size and coordinate are always even.

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
The zc143ac72mipi panel can only accept update area
that has even size and coordinates, so the panel
driver was updated to maintain a buffer to collect
all dirty areas. This buffer shall have address and
pitch alignments which compliant to the board's display
driver's requirement, and can be placed outside of ram.
Update the board specific overlay to add such configurations.

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
@KATE-WANG-NXP KATE-WANG-NXP force-pushed the update-zc143ac72mipi-co5300-display-example branch from 64a23e4 to 1e666df Compare November 28, 2025 06:17
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZC143AC72MIPI shows green horizontal lines when using running the lvgl samples.

10 participants