-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renesas: Smartbond: Add Display Driver Support #67649
Renesas: Smartbond: Add Display Driver Support #67649
Conversation
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
dff150c
to
4d83ce0
Compare
cef35f3
to
f2f9beb
Compare
a5df263
to
9a75397
Compare
83a4dec
to
62c8ff9
Compare
@danieldegrasse is there any further feedback? Could you remove the |
if LVGL | ||
|
||
# LCDC imposes display buffer be word aligned | ||
config LV_Z_VDB_ALIGN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default value, and can be dropped.
return ret; | ||
} | ||
|
||
static int display_smartbond_set_orientation(const struct device *dev, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this implementation needed? The display API no longer requires all functions be implemented, it will return -ENOSYS
if one isn't present.
* directly by LCDC and is allocated statically during device initialization. The color | ||
* format is defined based on the pixel-format property dictated by lcd-controller | ||
* bindings. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be consistent here as far as multi-instance versus single instance code. For example, if you wanted to make this block entirely multi instance, it would look something like this:
capabilities->supported_pixel_formats = config->pixel_format
capabilities->current_orientation = DISPLAY_ORIENTATION_NORMAL;
capabilities->current_pixel_format = config->pixel_format
capabilities->x_resolution = config->x_res;
capabilities->y_resolution = config->y_res;
Alternatively, an entirely single instance version would look like this:
capabilities->supported_pixel_formats = DT_INST_PROP(0, pixel_format);
capabilities->current_orientation = DISPLAY_ORIENTATION_NORMAL;
capabilities->current_pixel_format = DT_INST_PROP(0, pixel_format);
capabilities->x_resolution = DT_INST_PROP(inst, width);
capabilities->y_resolution = DT_INST_PROP(inst, height);
Personally, I would strongly prefer the driver is implemented as multi instance, since that is more scalable in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something we've already discussed - I'd prefer to keep this a single instance driver and revisit it in due course when there is necessity to do so.
const uint16_t x, const uint16_t y, | ||
const struct display_buffer_descriptor *desc, | ||
const void *buf) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with this LCD controller, but something that has been implemented for the ELCDIF (which is designed to stream a buffer in memory directly to the display) is to switch to the user provided buffer directly if the buffer is the same size as the output display.
full_fb = true; |
I'm not sure if this is something your controller supports, but it might be worth investigating- it improved performance quite a bit using LVGL with the ELCDIF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sure if this is going to work in our case. The main reasons is that LCDC imposes that pixel buffers be word aligned as well as the stride size (number of bytes per row). If you see, when I allocate the internal buffer I am making sure the necessary padding is added, if necessary. In addition, the copy from application to the internal buffer is done via the DMA accelerator mainly due to the stride alignment requirement as well as time efficiency. In fact, even if there was not the stride requirement, using memcpy
should result in making the device unresponsive when partial updates take place all the time. What is also not clear to me is, if LCDC employs application buffer directly then any rending performed during frame update shouldn't result in visual artifacts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is also not clear to me is, if LCDC employs application buffer directly then any rending performed during frame update shouldn't result in visual artifacts?
The trick here would be to queue the application buffer somehow, and not load it into the LCDC hardware until the last frame was done streaming. Again, I am not familiar with the hardware here- so this should be taken as an idea, nothing more. No need to implement it if it is not possible or not worth looking into
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see - such an architectural scheme should not work for us. However, I will spend some time on the underlying implementation :)
|
||
/* | ||
* Panel settings for the NHD-4.3-480272EF-ASXP-CTP | ||
* display panel model which integrates the SC7283 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit- fix indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation still looks wrong here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we are going to add overlays for each display supported with this board, it really might be valuable to consider moving these to the board dts
folder. There are other display samples in tree (and I suspect some customers will develop using the development kit and this display initially), so putting the overlays in the board's dts
folder will simplify supporting other display samples or customer applications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be parts that are not common for all sample codes/applications e.g. LVGL and input pointer. Then, one should create another overlay under application's board
folder to add the extra parts, isn't it? In addition, any overlay should be explicitly invoked during west build
since multiple overlays are expected per LCD interface type i.e. da1469x_dk_pro_lcdc.overlay, da1469x_dk_pro_mipi_dbi.overlay. This is something we discussed in the MIPI DBI PR since the same LCDC IP is used for different driver classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure- but defining the LVGL/input pointer in an application that does not use CONFIG_LVGL=y
will have no effect. I think you could probably simplify this to two overlays, one for the LCDC IP using the MIPI DBI driver class, and one for the LCDC IP using the display driver class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - I was a bit of unsure whether defining blocks that are not used would be acceptable or not.
62c8ff9
to
ec6003b
Compare
Exhibit Renesas LCD controller's driver implementation. The driver is intended to employ the controller in the continuous mode so it can drive display panels in the parallel RGB mode. Signed-off-by: Ioannis Karachalios <[email protected]>
ec61756
to
6a8ebc2
Compare
c97a6f4
to
93b3348
Compare
@@ -332,6 +332,13 @@ | |||
interrupts = <9 0>; | |||
}; | |||
|
|||
display: lcdc@30030000 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of defining the same IP block twice with different compatibles, you should override the compatible of the device in the overlay file, something like so:
da1469x.dtsi:
lcdc: lcdc@30030000 {
compatible = "renesas,smartbond-display";
reg = <0x30030000 0x18C>;
interrupts = <32 0>;
status = "disabled";
};
da1469x_dk_pro_mipi_dbi.overlay
&lcdc {
status = "okay";
compatible = "renesas,smartbond-mipi-dbi";
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hint. I followed your suggestion but I am now unable to build. In specific, when I try to build for the display compatible via
west build -p always -b da1469x_dk_pro samples/drivers/display/ -- -DDTC_OVERLAY_FILE="da1469x_dk_pro_lcdc.overlay"
I am getting errors on missing properties of the MIPI DBI compatible. The same goes if I build for the MIPI DBI compatible. Could you please check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forget my previous comment; I messed up the compatible properties between the display and MIPI DBI overlays :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries! Thanks for getting this changed :)
Define a single node that reflects the LCDC IP. Instead of defining the same IP block twice with different compatibles (mipi dbi, display) we define a single node for the default display interface and other interfaces like the MIPI DBI should override the compatible entry with the appropriate one within its DTS overlay file. Signed-off-by: Ioannis Karachalios <[email protected]>
93b3348
to
006b8d0
Compare
Update board's DTS configurations to support the Renesas LCD controller. Signed-off-by: Ioannis Karachalios <[email protected]>
90fa015
to
5482701
Compare
In order to avoid defining almost the same overlays for different sample codes and/or applications a common overlay file per display interface is defined under the boards dts folder. In doing so, an application/sample code will only have to define another overlay explicitly under application's board folder if more blocks are to be enabled. In either case, users should explicitly invoke the requested overfiles at 'west build' invokation by using the DTC_OVERLAY_FILE system variable. Signed-off-by: Ioannis Karachalios <[email protected]>
5482701
to
6dda7c0
Compare
@danieldegrasse many thanks for your contribution to this PR. |
No description provided.