| Message ID | 20251122205507.37387-4-johannes.goede@oss.qualcomm.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Hi Hans, thank you for the fix. Hans de Goede <johannes.goede@oss.qualcomm.com> writes: > The mimimum stride is width * bpp / 8 not width * bpp. > > Correct this to fix setting the stride to a value which is > 8 times too large. > > Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> > --- > This can be squashed into "libcamera: software_isp: egl: Add a eGL base > helper class" > --- > include/libcamera/internal/egl.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h > index e61a394a..5b7cb248 100644 > --- a/include/libcamera/internal/egl.h > +++ b/include/libcamera/internal/egl.h > @@ -75,7 +75,7 @@ public: > */ > eGLImage(uint32_t width, uint32_t height, uint32_t bpp, GLenum texture_unit, uint32_t texture_unit_uniform_id) > { > - uint32_t stride = libcamera::utils::alignUp(width * bpp, 256); > + uint32_t stride = libcamera::utils::alignUp(width * bpp / 8, 256); > > init(width, height, bpp, stride, texture_unit, texture_unit_uniform_id); > }
Le lundi 24 novembre 2025 à 15:37 +0100, Milan Zamazal a écrit : > Hi Hans, > > thank you for the fix. > > Hans de Goede <johannes.goede@oss.qualcomm.com> writes: > > > The mimimum stride is width * bpp / 8 not width * bpp. > > > > Correct this to fix setting the stride to a value which is > > 8 times too large. > > > > Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com> > > Reviewed-by: Milan Zamazal <mzamazal@redhat.com> > > > --- > > This can be squashed into "libcamera: software_isp: egl: Add a eGL base > > helper class" > > --- > > include/libcamera/internal/egl.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/include/libcamera/internal/egl.h > > b/include/libcamera/internal/egl.h > > index e61a394a..5b7cb248 100644 > > --- a/include/libcamera/internal/egl.h > > +++ b/include/libcamera/internal/egl.h > > @@ -75,7 +75,7 @@ public: > > */ > > eGLImage(uint32_t width, uint32_t height, uint32_t bpp, GLenum > > texture_unit, uint32_t texture_unit_uniform_id) > > { > > - uint32_t stride = libcamera::utils::alignUp(width * bpp, > > 256); > > + uint32_t stride = libcamera::utils::alignUp(width * bpp / > > 8, 256); Perhaps add comment that this is only valid for bpp being multiple of 8 and for packed format ? Nicolas > > > > init(width, height, bpp, stride, texture_unit, > > texture_unit_uniform_id); > > }
diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h index e61a394a..5b7cb248 100644 --- a/include/libcamera/internal/egl.h +++ b/include/libcamera/internal/egl.h @@ -75,7 +75,7 @@ public: */ eGLImage(uint32_t width, uint32_t height, uint32_t bpp, GLenum texture_unit, uint32_t texture_unit_uniform_id) { - uint32_t stride = libcamera::utils::alignUp(width * bpp, 256); + uint32_t stride = libcamera::utils::alignUp(width * bpp / 8, 256); init(width, height, bpp, stride, texture_unit, texture_unit_uniform_id); }
The mimimum stride is width * bpp / 8 not width * bpp. Correct this to fix setting the stride to a value which is 8 times too large. Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com> --- This can be squashed into "libcamera: software_isp: egl: Add a eGL base helper class" --- include/libcamera/internal/egl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)