From: sashiko-bot@kernel.org
To: "Amit Barzilai" <amit.barzilai22@gmail.com>
Cc: dri-devel@lists.freedesktop.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v6 2/6] drm/ssd130x: Change SSD133X color format to RGB565 from RGB332
Date: Mon, 14 Sep 2026 09:14:42 +0000 [thread overview]
Message-ID: <20260914091443.023141F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914085931.66857-3-amit.barzilai22@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing `fmtcnv_state` buffer reservation in `ssd133x_primary_plane_atomic_check` causes a `GFP_KERNEL` allocation in atomic context.
--
commit 58733b43936278b0113cbbd363c279ece2464617
Author: Amit Barzilai <amit.barzilai22@gmail.com>
drm/ssd130x: Change SSD133X color format to RGB565 from RGB332
SSD133X screens were driven at 8bpp RGB332 despite supporting 16bpp RGB565.
Switch the SSD133X data path to RGB565.
> diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
> index feec4933e3e6b..cbf77a74c4fa0 100644
> --- a/drivers/gpu/drm/solomon/ssd130x.c
> +++ b/drivers/gpu/drm/solomon/ssd130x.c
[ ... ]
> @@ -978,17 +990,18 @@ static int ssd133x_fb_blit_rect(struct drm_framebuffer *fb,
> struct drm_format_conv_state *fmtcnv_state)
> {
> struct ssd130x_device *ssd130x = drm_to_ssd130x(fb->dev);
> - const struct drm_format_info *fi = drm_format_info(DRM_FORMAT_RGB332);
> + const struct drm_format_info *fi;
> unsigned int dst_pitch;
> struct iosys_map dst;
>
> + fi = drm_format_info(DRM_FORMAT_RGB565);
> if (!fi)
> return -EINVAL;
>
> dst_pitch = drm_format_info_min_pitch(fi, 0, drm_rect_width(rect));
>
> iosys_map_set_vaddr(&dst, data_array);
> - drm_fb_xrgb8888_to_rgb332(&dst, &dst_pitch, vmap, fb, rect, fmtcnv_state);
> + drm_fb_xrgb8888_to_rgb565be(&dst, &dst_pitch, vmap, fb, rect, fmtcnv_state);
[Severity: High]
This is a pre-existing issue, but does this code cause a GFP_KERNEL allocation
in atomic context?
When the screen is updated, ssd133x_primary_plane_atomic_update() (which runs
in atomic context) calls ssd133x_fb_blit_rect() which in turn calls
drm_fb_xrgb8888_to_rgb565be().
This internally calls __drm_fb_xfrm(), which attempts a GFP_KERNEL allocation
if the conversion buffer was not previously reserved:
drivers/gpu/drm/drm_format_helper.c:__drm_fb_xfrm() {
if (!vaddr_cached_hint) {
stmp = drm_format_conv_state_reserve(state, sbuf_len, GFP_KERNEL);
if (!stmp)
return -ENOMEM;
}
}
Because ssd133x_primary_plane_atomic_check() omits the
drm_format_conv_state_reserve() call (unlike its ssd130x and ssd132x variants):
drivers/gpu/drm/solomon/ssd130x.c:ssd133x_primary_plane_atomic_check() {
...
else if (!plane_state->visible)
return 0;
return 0;
}
Will this cause the allocation to be unconditionally executed in atomic context
on the first frame update?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260914085931.66857-1-amit.barzilai22@gmail.com?part=2
next prev parent reply other threads:[~2026-09-14 9:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 8:59 [PATCH v6 0/6] drm/ssd130x: Add support for the Solomon SSD1351 OLED controller Amit Barzilai
2026-09-14 8:59 ` [PATCH v6 1/6] dt-bindings: display: Add " Amit Barzilai
2026-09-14 9:07 ` sashiko-bot
2026-09-14 8:59 ` [PATCH v6 2/6] drm/ssd130x: Change SSD133X color format to RGB565 from RGB332 Amit Barzilai
2026-09-14 9:14 ` sashiko-bot [this message]
2026-09-14 8:59 ` [PATCH v6 3/6] drm/ssd130x: Constify ssd130x_write_data() 'values' parameter Amit Barzilai
2026-09-14 8:59 ` [PATCH v6 4/6] drm/ssd130x: Replace positional ssd130x_spi_id[] initialization with C99 Amit Barzilai
2026-09-14 8:59 ` [PATCH v6 5/6] drm/ssd130x: Implement ssd130x_write_cmd() on top of ssd130x_write_cmds() Amit Barzilai
2026-09-14 8:59 ` [PATCH v6 6/6] drm/ssd130x: Add SSD135X_FAMILY and SSD1351 support Amit Barzilai
2026-09-14 9:27 ` sashiko-bot
2026-09-14 10:13 ` [PATCH v6 0/6] drm/ssd130x: Add support for the Solomon SSD1351 OLED controller Javier Martinez Canillas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260914091443.023141F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=amit.barzilai22@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox