Message ID | 20230713085859.907127-1-javierm@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1698386vqm; Thu, 13 Jul 2023 02:27:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlHrbnURsIjkYVckGA+D/cbq1XQ2WjQpsDYKVty6cb+jsAfbuLkOYYPRNPpl8nC0DEa1BvXT X-Received: by 2002:a05:6a20:28a2:b0:12f:bca:c2c6 with SMTP id q34-20020a056a2028a200b0012f0bcac2c6mr408698pzf.35.1689240441453; Thu, 13 Jul 2023 02:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689240441; cv=none; d=google.com; s=arc-20160816; b=yMp9sdPbs2gyHMOMp6cyOguCEtd7cRM3P8nOm6perNfME52FAmVcrHdrBvResLadW0 QolnWliS6KycYh87jrC4pme5NFzMh/HTZnpaEsERhSYBk0zI4eX1fy6J43TPVTW87sAN nAL5IKuk84oViGn+DfV8pgmon3Ee7/EPnpubeKScWJxooV/RuJswk9dA9wObtXKSj3tS B1d/JskkgytVH4KUyFqWPqKIfbOEHsofTP4HtSUBLSppEigtcErApiLG1VjDNYKcGfIg F7DzNAKm4ahkQJP7Gia1VR6SYcQUveGPYe/YUDDn9Ukek33g1lLAOKbrzBy2vso0BGd1 WFQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vnxC9yGQS3oyHtrj9CFhBKbzf8XATjvmszGm7K4qRhU=; fh=xQLzqvagBaT/JxUJ9S2F9j2c9SChg5Xo7G9xUwKva9s=; b=qJAd45JOfhnCElWVbCK1pxhvf2uhUh2JELpctgeWuku8B/he+4DDfPeWrGh417LoTU kWvKjuSq8gH9Fvc4M3NfMK4N0KdXTxXtCpjf7dGxliW+xHdqXhYRR5aJOw6HZFMNVMZ6 zMCqbqxS+IzXt4p45ijWWEPizyQbVIeroKv69H2W2akNTfurdaAWYJoffakY7huz3WHX r9OSueVTHeL7gmGY414mUvYEvZZoLBd6FdPVDE2VbdP3xjX3RKoRdV+dSPqzD0fyXLip dEXaP2ZD2D2HzSBIjBmKpkFaiNfww5KvUj67mflfp/yMRbmGqnnjMUnrgINe8G/lv3Ad Fdtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="J1+a/rwM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a11-20020a170902eccb00b001b89b7aea8fsi647790plh.493.2023.07.13.02.27.09; Thu, 13 Jul 2023 02:27:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="J1+a/rwM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234655AbjGMJAQ (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Thu, 13 Jul 2023 05:00:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234308AbjGMJAK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Jul 2023 05:00:10 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E9071FDB for <linux-kernel@vger.kernel.org>; Thu, 13 Jul 2023 01:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689238766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vnxC9yGQS3oyHtrj9CFhBKbzf8XATjvmszGm7K4qRhU=; b=J1+a/rwMuijE91Vn5WWEKx20adjFromES5t0W5WYM5x+2GwZ9NSTh3DXaaljY1cqQz5GSD BJVUYvbetE22rT5Ww1yxPm4BmVRvVaZvm/AA2tqq/gP/ebcGirDzCx8aF20F4gPfrWtEKp 8aGae1ykkct5uBw2pl+n099q56rFmd0= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-571-XjQDjZ86M6CjAkN_w4kGqg-1; Thu, 13 Jul 2023 04:59:25 -0400 X-MC-Unique: XjQDjZ86M6CjAkN_w4kGqg-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2b701e0bb10so4256391fa.3 for <linux-kernel@vger.kernel.org>; Thu, 13 Jul 2023 01:59:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689238764; x=1691830764; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vnxC9yGQS3oyHtrj9CFhBKbzf8XATjvmszGm7K4qRhU=; b=Rqx8lqzgBmP3V9KdcpSzQAUxqhECE3JFN6KPD79EuS+IfQYESibb1K4rodOB/twwMb 2AXbJmMyS1d5XdHqZOjQMZMw3aT06p85Y2AhZ+uK2fpqyyGrry3rp7Ykdp95pDnMSlJ3 AYDu1PTGrrQ90ak+WjH+wtojoke+i1AVvfWup8593RbioDYFbHo64is0LN7aheAwZJUs N69MxInZ+FPjZO9WC79Uz7neGO9RAdmRzFhWE9j+7xL4CHIFev4Ap8M+3JySSruRwoAu 7NAi/Jq94lcj7BU1u0bOt5m8C6TmkjT7Dp2uEgJ2BbLKQudJniYgI9FweAdQFtsHoJUT ITmw== X-Gm-Message-State: ABy/qLZkr9lBmGhESLXfNurB+kODVpmtCJPHDRfwDaOksMUwKVO7N4Zy 1QJsdyhLslRknvx5kQk8rVwioHfMGgmw6KXx9tAJX4icgDvr0Gq2hg6U0/it7CwCEyEx5IGJH68 uWcax6zyGvc9aGx7ZdPmtkXYshmW3O+U1Fqx0jzmkDrH0Mh6oYtvnvu7qgsJyrKV8I3EOBzF94U K7IThrJ10= X-Received: by 2002:ac2:4d0a:0:b0:4fb:61ea:95dc with SMTP id r10-20020ac24d0a000000b004fb61ea95dcmr668303lfi.7.1689238763918; Thu, 13 Jul 2023 01:59:23 -0700 (PDT) X-Received: by 2002:ac2:4d0a:0:b0:4fb:61ea:95dc with SMTP id r10-20020ac24d0a000000b004fb61ea95dcmr668279lfi.7.1689238763561; Thu, 13 Jul 2023 01:59:23 -0700 (PDT) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id a4-20020adfeec4000000b0030c4d8930b1sm7356588wrp.91.2023.07.13.01.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 01:59:23 -0700 (PDT) From: Javier Martinez Canillas <javierm@redhat.com> To: linux-kernel@vger.kernel.org Cc: Javier Martinez Canillas <javierm@redhat.com>, Geert Uytterhoeven <geert@linux-m68k.org>, Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ssd130x: Change pixel format used to compute the buffer size Date: Thu, 13 Jul 2023 10:58:07 +0200 Message-ID: <20230713085859.907127-1-javierm@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771296985112800766 X-GMAIL-MSGID: 1771296985112800766 |
Series |
drm/ssd130x: Change pixel format used to compute the buffer size
|
|
Commit Message
Javier Martinez Canillas
July 13, 2023, 8:58 a.m. UTC
The commit e254b584dbc0 ("drm/ssd130x: Remove hardcoded bits-per-pixel in
ssd130x_buf_alloc()") used a pixel format info instead of a hardcoded bpp
to calculate the size of the buffer allocated to store the native pixels.
But that wrongly used the DRM_FORMAT_C1 fourcc pixel format, which is for
color-indexed frame buffer formats. While the ssd103x controllers don't
support different single-channel colors nor a Color Lookup Table (CLUT).
Both formats use eight pixels/byte, so in practice there is no functional
changes in this patch. But still the correct pixel format should be used.
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/gpu/drm/solomon/ssd130x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Jul 13, 2023 at 10:59 AM Javier Martinez Canillas <javierm@redhat.com> wrote: > The commit e254b584dbc0 ("drm/ssd130x: Remove hardcoded bits-per-pixel in > ssd130x_buf_alloc()") used a pixel format info instead of a hardcoded bpp > to calculate the size of the buffer allocated to store the native pixels. > > But that wrongly used the DRM_FORMAT_C1 fourcc pixel format, which is for > color-indexed frame buffer formats. While the ssd103x controllers don't > support different single-channel colors nor a Color Lookup Table (CLUT). > > Both formats use eight pixels/byte, so in practice there is no functional > changes in this patch. But still the correct pixel format should be used. > > Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> > Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Gr{oetje,eeting}s, Geert
Am 13.07.23 um 10:58 schrieb Javier Martinez Canillas: > The commit e254b584dbc0 ("drm/ssd130x: Remove hardcoded bits-per-pixel in > ssd130x_buf_alloc()") used a pixel format info instead of a hardcoded bpp > to calculate the size of the buffer allocated to store the native pixels. > > But that wrongly used the DRM_FORMAT_C1 fourcc pixel format, which is for > color-indexed frame buffer formats. While the ssd103x controllers don't > support different single-channel colors nor a Color Lookup Table (CLUT). Makes sense to me. Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> > > Both formats use eight pixels/byte, so in practice there is no functional > changes in this patch. But still the correct pixel format should be used. > > Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> > Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> > --- > > drivers/gpu/drm/solomon/ssd130x.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c > index b3dc1ca9dc10..afb08a8aa9fc 100644 > --- a/drivers/gpu/drm/solomon/ssd130x.c > +++ b/drivers/gpu/drm/solomon/ssd130x.c > @@ -153,7 +153,7 @@ static int ssd130x_buf_alloc(struct ssd130x_device *ssd130x) > const struct drm_format_info *fi; > unsigned int pitch; > > - fi = drm_format_info(DRM_FORMAT_C1); > + fi = drm_format_info(DRM_FORMAT_R1); > if (!fi) > return -EINVAL; > -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann <tzimmermann@suse.de> writes: > Am 13.07.23 um 10:58 schrieb Javier Martinez Canillas: >> The commit e254b584dbc0 ("drm/ssd130x: Remove hardcoded bits-per-pixel in >> ssd130x_buf_alloc()") used a pixel format info instead of a hardcoded bpp >> to calculate the size of the buffer allocated to store the native pixels. >> >> But that wrongly used the DRM_FORMAT_C1 fourcc pixel format, which is for >> color-indexed frame buffer formats. While the ssd103x controllers don't >> support different single-channel colors nor a Color Lookup Table (CLUT). > > Makes sense to me. > > Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> > Thanks Geert and Thomas for your review. I've fixed some typos that had in my commit message and pushed this to drm-misc-next.
diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index b3dc1ca9dc10..afb08a8aa9fc 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -153,7 +153,7 @@ static int ssd130x_buf_alloc(struct ssd130x_device *ssd130x) const struct drm_format_info *fi; unsigned int pitch; - fi = drm_format_info(DRM_FORMAT_C1); + fi = drm_format_info(DRM_FORMAT_R1); if (!fi) return -EINVAL;