[{"id":37025,"web_url":"https://patchwork.libcamera.org/comment/37025/","msgid":"<85zf8bmr8q.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-11-24T14:37:09","subject":"Re: [PATCH 3/3] libcamera: egl: Fix eGLImage() constructor stride\n\tcalculation","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Hans,\n\nthank you for the fix.\n\nHans de Goede <johannes.goede@oss.qualcomm.com> writes:\n\n> The mimimum stride is width * bpp / 8 not width * bpp.\n>\n> Correct this to fix setting the stride to a value which is\n> 8 times too large.\n>\n> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n> This can be squashed into \"libcamera: software_isp: egl: Add a eGL base\n> helper class\"\n> ---\n>  include/libcamera/internal/egl.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h\n> index e61a394a..5b7cb248 100644\n> --- a/include/libcamera/internal/egl.h\n> +++ b/include/libcamera/internal/egl.h\n> @@ -75,7 +75,7 @@ public:\n>  \t */\n>  \teGLImage(uint32_t width, uint32_t height, uint32_t bpp, GLenum texture_unit, uint32_t texture_unit_uniform_id)\n>  \t{\n> -\t\tuint32_t stride = libcamera::utils::alignUp(width * bpp, 256);\n> +\t\tuint32_t stride = libcamera::utils::alignUp(width * bpp / 8, 256);\n>  \n>  \t\tinit(width, height, bpp, stride, texture_unit, texture_unit_uniform_id);\n>  \t}","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A8143C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 Nov 2025 14:37:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0EF2960AA0;\n\tMon, 24 Nov 2025 15:37:19 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A6A9609D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Nov 2025 15:37:17 +0100 (CET)","from mail-wr1-f70.google.com (mail-wr1-f70.google.com\n\t[209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-210-SuA-EnyfNSeFLiXe8fu-fg-1; Mon, 24 Nov 2025 09:37:13 -0500","by mail-wr1-f70.google.com with SMTP id\n\tffacd0b85a97d-42b3b5ed793so2807750f8f.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Nov 2025 06:37:12 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-42cb7fa3592sm27392327f8f.21.2025.11.24.06.37.10\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 24 Nov 2025 06:37:10 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"TvV+Lw53\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1763995036;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=XZ0sUSe5w4BfRPRdGzwzfhkBV4vR430/zz/a20Wf/Tc=;\n\tb=TvV+Lw53j+wPCOQ4nybtQ+IYmB6BCAaF7nWW+SmQm9djO5/oOamQ2KTMcfYDODOhOMik7C\n\tLQgByCGqQ+kqukijnaGUpWbj2mFF91TnYGBb3M46XtwdnWmUyMPtf8JAWAh+GCMTpAmpZ4\n\tM7YduvMlHIejdovDn7JJPl7TwBWwJtI=","X-MC-Unique":"SuA-EnyfNSeFLiXe8fu-fg-1","X-Mimecast-MFC-AGG-ID":"SuA-EnyfNSeFLiXe8fu-fg_1763995032","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1763995031; x=1764599831;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=XZ0sUSe5w4BfRPRdGzwzfhkBV4vR430/zz/a20Wf/Tc=;\n\tb=alkUc+Q77H060h6N9mPmKZVSpNrYO7EmtuNe57e233h2+luUY5ZVjvyfrNkYFz2auC\n\tSzg+k9WyjzSnTa5NZ8ztcWOuKjwKb4wFOTYuRQa3Pkrcmv42HGpWIxdvC97hrqFBbPgx\n\tcsvbR3xuVQrzAzbjHRVUPVnsxeMq5eOrxEBGYs6pDwdOpmQ/EO4hhZ0TsELABrLEaK0P\n\tZJ2jqbY0V+yU+gkG+VRhsYJ4GLIChXTJA6NnzGMYC0wIESH1pqjOneuL3jSqfiWEq/Mb\n\tJkoXGzx+RpjfLOC4UpzPiBGlKP4Gy1qYNtZ0ztZrn6fUzhHwjGftIqLVQ5JQhUiPSf0E\n\t5ANQ==","X-Gm-Message-State":"AOJu0YzvTYgRWxqfcJFykUievv/ah+8e0+0tnTWOmXbx7Z1dY5lSW8p4\n\t2fWqw0n79+4jiuQkHprjDR5DjL6JKFqg/7cpL4Y9rvsOZtHEByWWM9PehynHLZs0zA1FqotNq/4\n\t3UPb3+KFJO5M6xXBdl2L+JDhsRduBuFrAbMSsfu/bW+gRMnr8QD1kbHhJbGM2mQemUyBFmoQ9sE\n\tF2u2YTdWw=","X-Gm-Gg":"ASbGnctDNbzC4Kbi6oIz7cZSyPYhhOaWP4juVp178YQW+eQ+kLTWxe/pRvhgxrTjMFo\n\tniOhiaDT+iL1p5xViHBJWsjX5nhz0LmgBo/KUkUpjF6WGAQlt1/9o+3oGeWBQlTe1ZCLCiTY2qI\n\thEG4Blh9/6mtg0DN/pxEfnb0IZz675IG5+ji3rto/kp+zoPgmQLF+9h9zcsFUZ/FbFtQSEKSQab\n\tzInwuaa/HovI5wR46CGYEI80NWKYoa32CFissyGwrMe5IFsGf2G0/k9Uy9+TxKLq+7zqAONOefM\n\t5ZaUVDJ2o/nuXHtHAkqEoPX0wIBu2HUB1nJo0R7GNsZzbXi1yk2SjaKQWkRlYDkXCOTKLg3Jjzz\n\tqO56w3hPUbqhNr1xFS22W3Fl0Ef3m3yubEWpTxKiY+jszloMPi+FuWHgVHtnZzAA=","X-Received":["by 2002:a05:6000:2f88:b0:42b:3366:6330 with SMTP id\n\tffacd0b85a97d-42cc1d22db5mr11443422f8f.57.1763995031593; \n\tMon, 24 Nov 2025 06:37:11 -0800 (PST)","by 2002:a05:6000:2f88:b0:42b:3366:6330 with SMTP id\n\tffacd0b85a97d-42cc1d22db5mr11443388f8f.57.1763995031187; \n\tMon, 24 Nov 2025 06:37:11 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IFdCoBhAeaLes03OwLdgTt3QuU8jN3TJFZ8chx22N7MLE7qfSsqc4SMMvIKr7eaahtCRJtcCA==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Hans de Goede <johannes.goede@oss.qualcomm.com>","Cc":"libcamera-devel@lists.libcamera.org,  Bryan O'Donoghue\n\t<bryan.odonoghue@linaro.org>","Subject":"Re: [PATCH 3/3] libcamera: egl: Fix eGLImage() constructor stride\n\tcalculation","In-Reply-To":"<20251122205507.37387-4-johannes.goede@oss.qualcomm.com> (Hans\n\tde Goede's message of \"Sat, 22 Nov 2025 21:55:07 +0100\")","References":"<20251122205507.37387-1-johannes.goede@oss.qualcomm.com>\n\t<20251122205507.37387-4-johannes.goede@oss.qualcomm.com>","Date":"Mon, 24 Nov 2025 15:37:09 +0100","Message-ID":"<85zf8bmr8q.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"Sl6I8e9mEcWfpXXkjSdAdxrxmzPp0B08FE9eCVpBelY_1763995032","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":37027,"web_url":"https://patchwork.libcamera.org/comment/37027/","msgid":"<4bce5cbed50313dcd08d4344b8b0cec1216f3427.camel@ndufresne.ca>","date":"2025-11-24T14:48:33","subject":"Re: [PATCH 3/3] libcamera: egl: Fix eGLImage() constructor stride\n\tcalculation","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Le lundi 24 novembre 2025 à 15:37 +0100, Milan Zamazal a écrit :\n> Hi Hans,\n> \n> thank you for the fix.\n> \n> Hans de Goede <johannes.goede@oss.qualcomm.com> writes:\n> \n> > The mimimum stride is width * bpp / 8 not width * bpp.\n> > \n> > Correct this to fix setting the stride to a value which is\n> > 8 times too large.\n> > \n> > Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>\n> \n> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>\n> \n> > ---\n> > This can be squashed into \"libcamera: software_isp: egl: Add a eGL base\n> > helper class\"\n> > ---\n> >  include/libcamera/internal/egl.h | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> > \n> > diff --git a/include/libcamera/internal/egl.h\n> > b/include/libcamera/internal/egl.h\n> > index e61a394a..5b7cb248 100644\n> > --- a/include/libcamera/internal/egl.h\n> > +++ b/include/libcamera/internal/egl.h\n> > @@ -75,7 +75,7 @@ public:\n> >  \t */\n> >  \teGLImage(uint32_t width, uint32_t height, uint32_t bpp, GLenum\n> > texture_unit, uint32_t texture_unit_uniform_id)\n> >  \t{\n> > -\t\tuint32_t stride = libcamera::utils::alignUp(width * bpp,\n> > 256);\n> > +\t\tuint32_t stride = libcamera::utils::alignUp(width * bpp /\n> > 8, 256);\n\nPerhaps add comment that this is only valid for bpp being multiple of 8 and for\npacked format ?\n\nNicolas\n\n> >  \n> >  \t\tinit(width, height, bpp, stride, texture_unit,\n> > texture_unit_uniform_id);\n> >  \t}","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 50969C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 Nov 2025 14:48:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 107AF60A80;\n\tMon, 24 Nov 2025 15:48:39 +0100 (CET)","from mail-qk1-x730.google.com (mail-qk1-x730.google.com\n\t[IPv6:2607:f8b0:4864:20::730])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CFF4E6096B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Nov 2025 15:48:37 +0100 (CET)","by mail-qk1-x730.google.com with SMTP id\n\taf79cd13be357-8b2dcdde65bso648832085a.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Nov 2025 06:48:37 -0800 (PST)","from ?IPv6:2606:6d00:17:7b4b::5ac? ([2606:6d00:17:7b4b::5ac])\n\tby smtp.gmail.com with ESMTPSA id\n\taf79cd13be357-8b3295e4b96sm955604185a.45.2025.11.24.06.48.35\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 24 Nov 2025 06:48:35 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=ndufresne-ca.20230601.gappssmtp.com\n\theader.i=@ndufresne-ca.20230601.gappssmtp.com\n\theader.b=\"BOsAsIo4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ndufresne-ca.20230601.gappssmtp.com; s=20230601; t=1763995717;\n\tx=1764600517; darn=lists.libcamera.org; \n\th=mime-version:user-agent:references:in-reply-to:date:cc:to:from\n\t:subject:message-id:from:to:cc:subject:date:message-id:reply-to;\n\tbh=ilkrQsodibf6hYE5dMxSaZkt0TRs55va+cT9eTSsU84=;\n\tb=BOsAsIo4LpHm1zmAdU9MzMdSdUn1qHPl+nx83Z9CiAREZhBiOfQwm5N/90AhOL+c3v\n\tBF7sM19gIyPD0z3XncOVqvQRlwqLhLh2oVOn3tVdJ3fTQQRElV/u37k3vu37LyNKt5Bh\n\tP6RtnXtyV/W0emaei79U1SskhLvuvvxaCcxWzkucPk9vccbp/7C+XCs20NvbQvAg3SQj\n\t/RO5ztj7mNEDUGoDXRLhHKaiytfFftzAYOx9RE3i5OuadLtxqehp4ZqVgeAC3kPPi1lI\n\tp5XHGPWshT8Z+JTbLQi4JeB4kn43MS0pUU9XDMmMb1UlO58g8PKINcaz51E0vdRC6FgY\n\t2ctA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1763995717; x=1764600517;\n\th=mime-version:user-agent:references:in-reply-to:date:cc:to:from\n\t:subject:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=ilkrQsodibf6hYE5dMxSaZkt0TRs55va+cT9eTSsU84=;\n\tb=kLTIf9l2h+ZL6+VD2qJRL9x9n7VdCFkqsqGmANqAhYRE+4nGm5StKS2LTj2HQnM5F+\n\twUHzYKybzpIkEce+wSP8V+ACVbj+BQyWj4FCNXQPgcKkx7IlnJr6SUWBSatgpelwdRaq\n\te2k8yT9No/60eAfNi7YJeNUxD6/LdN9GvykuXOsTeCHVxbqN8hYRDxiVg6gjGozXzGeE\n\tqi4rPMnjOfOxX8lRo6BiwEx/6Rake/iEJZuoeSNsW8QZuIUVlXzyL8ZegsDydGPm9mdF\n\tJPjYg5x83G9EFOT8Vwf6PMTinX/R4UO/hANyvZtn63/sk0l162MY29XVIkk4TWn4bveo\n\tJfrQ==","X-Gm-Message-State":"AOJu0YyODsHCdugjsoFs4HLAbpOIxW8/xkbT1iBjITk809nT/1w6Q8pm\n\tNnnzN8m4kBw3pQKrAF1oSvkSZ+61KNIK4jht1RMMmruj7J26eZeL7OyTUWTZECW3ZOU=","X-Gm-Gg":"ASbGnct4MXfAGXNCOnoMp/zmPGcWrLItuVMBj3l/fz+ywXwi3R7oj6LYMOKYOj2EMeA\n\tSxSYUdAbQcwIJjsVMv8S+wMY4UuBdVWwyK44Tr8jad6tsg+KY37rrS8aOxvrDjzpf8al0aKCeiV\n\tptp0xARIj6mBBhUZEH0quy4UP9BNyN03KNZ0oAKaHn9APO9tb9e1XpajgYED+0Txy63CdWIWOAK\n\tPmf0TJgzohYgIQ3VukrdvOap0HQdLehsyVzZk8zi4jDVxR7GnkxIoSYGJtGbgsn8OAYwO0GyRKd\n\t966xGHuL8Lo7j9O3SAHi4SMzgjDY/veRcpRUqEvXAvPkKqKInYaodLtiAVVXq8ykG8J++ttflzj\n\tdWW5TK/WGroaJZiRGUnh0t980xPg2KmcV5C8e3G8Z9Pos9zscy/ZEn6bfGv8wEr8lkJUgT3ewOm\n\tvQ0CCQiY6h0Sc4TdIF","X-Google-Smtp-Source":"AGHT+IHqZzO4PGaMtbhb91Br4RtPaXZ3/fNbMsGvwo/017jJowf4Zsh6lob3SwXfWLAM+Owilv2H2Q==","X-Received":"by 2002:a05:620a:29c5:b0:86e:ff4e:d55e with SMTP id\n\taf79cd13be357-8b33d264849mr1685549485a.39.1763995716456; \n\tMon, 24 Nov 2025 06:48:36 -0800 (PST)","Message-ID":"<4bce5cbed50313dcd08d4344b8b0cec1216f3427.camel@ndufresne.ca>","Subject":"Re: [PATCH 3/3] libcamera: egl: Fix eGLImage() constructor stride\n\tcalculation","From":"Nicolas Dufresne <nicolas@ndufresne.ca>","To":"Milan Zamazal <mzamazal@redhat.com>, Hans de Goede\n\t<johannes.goede@oss.qualcomm.com>","Cc":"libcamera-devel@lists.libcamera.org, Bryan O'Donoghue\n\t<bryan.odonoghue@linaro.org>","Date":"Mon, 24 Nov 2025 09:48:33 -0500","In-Reply-To":"<85zf8bmr8q.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","References":"<20251122205507.37387-1-johannes.goede@oss.qualcomm.com>\n\t<20251122205507.37387-4-johannes.goede@oss.qualcomm.com>\n\t<85zf8bmr8q.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","Content-Type":"multipart/signed; micalg=\"pgp-sha512\";\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"=-Zv2QprdL5IHWRcswmZ0o\"","User-Agent":"Evolution 3.58.1 (3.58.1-1.fc43) ","MIME-Version":"1.0","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]