Skip to content

fix(pxp): fix issues in pxp cache management callback - #5685

Merged
kisvegabor merged 1 commit into
lvgl:masterfrom
hpfaz:bugfix/pxp_callback_signature
Feb 22, 2024
Merged

fix(pxp): fix issues in pxp cache management callback#5685
kisvegabor merged 1 commit into
lvgl:masterfrom
hpfaz:bugfix/pxp_callback_signature

Conversation

@hpfaz

@hpfaz hpfaz commented Feb 19, 2024

Copy link
Copy Markdown
Contributor

Description of the feature or fix

fix _invalidate_cache wrong signature in declaration
fix _invalidate_cache uses draw_buf as a data buffer
fix _invalidate_cache uses unknown DEMO_CleanInvalidateCacheByAddr instead of DCACHE_CleanInvalidateByRange
update the *invalidate_cache* functions signature to make draw_buf a pointer to const

Notes

fix _invalidate_cache wrong signature in declaration
fix _invalidate_cache uses draw_buf as a data buffer
fix _invalidate_cache uses unkown DEMO_CleanInvalidateCacheByAddr
instead of DCACHE_CleanInvalidateByRange
update the *invalidate_cache* functions signature to make draw_buf a
pointer to const

Signed-off-by: Hatim-Pierre FAZILEABASSE <hatim-pierre.fazileabasse@ingenico.com>
@XuNeo

XuNeo commented Feb 19, 2024

Copy link
Copy Markdown
Collaborator

Hi,
Thank you for the fix. Could you explain why need to add const to draw_buf?

@hpfaz

hpfaz commented Feb 19, 2024

Copy link
Copy Markdown
Contributor Author

Hi @XuNeo,

I added the 'const' because in lv_draw_pxp_layer draw_buf is declared as follows :
const lv_draw_buf_t * draw_buf = layer_to_draw->draw_buf;
and then used in:
lv_draw_buf_invalidate_cache(draw_buf, &area_to_draw);

On CLang this will result in the following warning:
passing 'const lv_draw_buf_t *' to parameter of type 'lv_draw_buf_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]

And since draw_buf itself should not be affected by cache management operations on draw_buf->data it felt right to propagate the constness requirement.

@hpfaz
hpfaz marked this pull request as ready for review February 19, 2024 11:12
@XuNeo
XuNeo requested a review from kisvegabor February 20, 2024 02:00
@kisvegabor
kisvegabor merged commit cde82c1 into lvgl:master Feb 22, 2024
@hpfaz
hpfaz deleted the bugfix/pxp_callback_signature branch February 23, 2024 10:28
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
Signed-off-by: Hatim-Pierre FAZILEABASSE <hatim-pierre.fazileabasse@ingenico.com>
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
Signed-off-by: Hatim-Pierre FAZILEABASSE <hatim-pierre.fazileabasse@ingenico.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants