diff mbox series

[meta-oe,v4,6/7] lvgl: fix libdrm include

Message ID 20240316100056.409758-6-chris.chapuis@gmail.com
State New
Headers show
Series [meta-oe,v4,1/7] lvgl: fix typo in lv-conf.inc | expand

Commit Message

Christophe Chapuis March 16, 2024, 10 a.m. UTC
When DRM is activated for LVGL, it adds a dependency on drm.h.
As for lvgl-demo-fb, add an include path to fix this usecase.

Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
---
 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb | 2 ++
 1 file changed, 2 insertions(+)

Comments

Khem Raj March 16, 2024, 4:08 p.m. UTC | #1
does this fix

https://errors.yoctoproject.org/Errors/Details/758522/

On Sat, Mar 16, 2024 at 3:01 AM Christophe Chapuis
<chris.chapuis@gmail.com> wrote:
>
> When DRM is activated for LVGL, it adds a dependency on drm.h.
> As for lvgl-demo-fb, add an include path to fix this usecase.
>
> Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
> ---
>  meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> index 8bd718efd..6a9a7411b 100644
> --- a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> +++ b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> @@ -21,6 +21,8 @@ inherit cmake
>  EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON"
>  S = "${WORKDIR}/git"
>
> +TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
> +
>  ALLOW_EMPTY:${PN} = "1"
>
>  PACKAGECONFIG ??= "drm"
> --
> 2.44.0
>
Christophe Chapuis March 16, 2024, 4:17 p.m. UTC | #2
Yes, it fixes exactly this issue.

On Sat, Mar 16, 2024 at 5:09 PM Khem Raj <raj.khem@gmail.com> wrote:

> does this fix
>
> https://errors.yoctoproject.org/Errors/Details/758522/
>
> On Sat, Mar 16, 2024 at 3:01 AM Christophe Chapuis
> <chris.chapuis@gmail.com> wrote:
> >
> > When DRM is activated for LVGL, it adds a dependency on drm.h.
> > As for lvgl-demo-fb, add an include path to fix this usecase.
> >
> > Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
> > ---
> >  meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> > index 8bd718efd..6a9a7411b 100644
> > --- a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> > +++ b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> > @@ -21,6 +21,8 @@ inherit cmake
> >  EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON"
> >  S = "${WORKDIR}/git"
> >
> > +TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
> > +
> >  ALLOW_EMPTY:${PN} = "1"
> >
> >  PACKAGECONFIG ??= "drm"
> > --
> > 2.44.0
> >
>
Khem Raj March 16, 2024, 4:30 p.m. UTC | #3
Ok thx

On Sat, Mar 16, 2024 at 9:18 AM Christophe Chapuis <chris.chapuis@gmail.com>
wrote:

> Yes, it fixes exactly this issue.
>
> On Sat, Mar 16, 2024 at 5:09 PM Khem Raj <raj.khem@gmail.com> wrote:
>
>> does this fix
>>
>> https://errors.yoctoproject.org/Errors/Details/758522/
>>
>> On Sat, Mar 16, 2024 at 3:01 AM Christophe Chapuis
>> <chris.chapuis@gmail.com> wrote:
>> >
>> > When DRM is activated for LVGL, it adds a dependency on drm.h.
>> > As for lvgl-demo-fb, add an include path to fix this usecase.
>> >
>> > Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
>> > ---
>> >  meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb | 2 ++
>> >  1 file changed, 2 insertions(+)
>> >
>> > diff --git a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
>> b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
>> > index 8bd718efd..6a9a7411b 100644
>> > --- a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
>> > +++ b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
>> > @@ -21,6 +21,8 @@ inherit cmake
>> >  EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON"
>> >  S = "${WORKDIR}/git"
>> >
>> > +TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
>> > +
>> >  ALLOW_EMPTY:${PN} = "1"
>> >
>> >  PACKAGECONFIG ??= "drm"
>> > --
>> > 2.44.0
>> >
>>
>
Marek Vasut March 16, 2024, 8:42 p.m. UTC | #4
On 3/16/24 11:00 AM, Christophe Chapuis wrote:
> When DRM is activated for LVGL, it adds a dependency on drm.h.
> As for lvgl-demo-fb, add an include path to fix this usecase.
> 
> Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
> ---
>   meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> index 8bd718efd..6a9a7411b 100644
> --- a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> +++ b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> @@ -21,6 +21,8 @@ inherit cmake
>   EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON"
>   S = "${WORKDIR}/git"
>   
> +TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"

Shouldn't this be conditional only if PACKAGECONFIG contains 'drm' ?
Christophe Chapuis March 16, 2024, 9:55 p.m. UTC | #5
It could be conditional eventually; I just took the line from lvgl-demo-fb,
where it wasn't.

Ideally, both should be moved in lv-conf.inc, where the lvgl drm setting is
activated. But I didn't want to expand again the scope of this patchset,
initially focused simply on adding some variables to lv-conf.inc.

On Sat, Mar 16, 2024 at 10:08 PM Marek Vasut <marex@denx.de> wrote:

> On 3/16/24 11:00 AM, Christophe Chapuis wrote:
> > When DRM is activated for LVGL, it adds a dependency on drm.h.
> > As for lvgl-demo-fb, add an include path to fix this usecase.
> >
> > Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
> > ---
> >   meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> > index 8bd718efd..6a9a7411b 100644
> > --- a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> > +++ b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
> > @@ -21,6 +21,8 @@ inherit cmake
> >   EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON"
> >   S = "${WORKDIR}/git"
> >
> > +TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
>
> Shouldn't this be conditional only if PACKAGECONFIG contains 'drm' ?
>
Marek Vasut March 17, 2024, 5:44 a.m. UTC | #6
On 3/16/24 10:55 PM, Christophe Chapuis wrote:
> It could be conditional eventually; I just took the line from lvgl-demo-fb,
> where it wasn't.
> 
> Ideally, both should be moved in lv-conf.inc, where the lvgl drm setting is
> activated. But I didn't want to expand again the scope of this patchset,
> initially focused simply on adding some variables to lv-conf.inc.

I think I will just defer that decision to Khem.

My concern is that a system with SDL or fbdev backend may not have 
libdrm available, so I think it should be conditional.

I think this will handle that concern:

TARGET_CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'drm', 
'-I${STAGING_INCDIR}/libdrm', '', d)}"
Martin Jansa March 17, 2024, 7:46 a.m. UTC | #7
The extra -I flag won't harm even when libdrm isn't there.

lvgl-demo-fb also doesn't do it conditionally based on drm PACKAGECONFIG.

If someone want's to fix this properly then should also use pkg-config
(and tests/FindLibDRM.cmake in the lvgl repo), but lets not block this
fix based on that.

This whole issue is just revealed by the typo fix in
https://patchwork.yoctoproject.org/project/oe/patch/20240316100056.409758-1-chris.chapuis@gmail.com/
which fixed lv-conf.inc to work for lvgl resulting in LV_USE_LINUX_DRM
being respected based on PACKAGECONFIG drm.

Acked-by: Martin Jansa <martin.jansa@gmail.com>

On Sun, Mar 17, 2024 at 6:45 AM Marek Vasut <marex@denx.de> wrote:
>
> On 3/16/24 10:55 PM, Christophe Chapuis wrote:
> > It could be conditional eventually; I just took the line from lvgl-demo-fb,
> > where it wasn't.
> >
> > Ideally, both should be moved in lv-conf.inc, where the lvgl drm setting is
> > activated. But I didn't want to expand again the scope of this patchset,
> > initially focused simply on adding some variables to lv-conf.inc.
>
> I think I will just defer that decision to Khem.
>
> My concern is that a system with SDL or fbdev backend may not have
> libdrm available, so I think it should be conditional.
>
> I think this will handle that concern:
>
> TARGET_CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'drm',
> '-I${STAGING_INCDIR}/libdrm', '', d)}"
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#109376): https://lists.openembedded.org/g/openembedded-devel/message/109376
> Mute This Topic: https://lists.openembedded.org/mt/104964303/3617156
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [martin.jansa@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Marek Vasut March 17, 2024, 4:02 p.m. UTC | #8
On 3/17/24 8:46 AM, Martin Jansa wrote:
> The extra -I flag won't harm even when libdrm isn't there.
> 
> lvgl-demo-fb also doesn't do it conditionally based on drm PACKAGECONFIG.
> 
> If someone want's to fix this properly then should also use pkg-config
> (and tests/FindLibDRM.cmake in the lvgl repo), but lets not block this
> fix based on that.

The CMake fix is already being worked on upstream.

For completeness:

Reviewed-by: Marek Vasut <marex@denx.de>
diff mbox series

Patch

diff --git a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
index 8bd718efd..6a9a7411b 100644
--- a/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
+++ b/meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
@@ -21,6 +21,8 @@  inherit cmake
 EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON"
 S = "${WORKDIR}/git"
 
+TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
+
 ALLOW_EMPTY:${PN} = "1"
 
 PACKAGECONFIG ??= "drm"