Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp201649pxb; Tue, 15 Feb 2022 11:21:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJy+kvfUhkLAmMmN1juD8jdDFRdxu2u8JSUKJuva5QZnDV9NJ4LJ/u9UuZPYN4HSuwQxGtfk X-Received: by 2002:a17:90a:1b25:: with SMTP id q34mr9663pjq.173.1644952865051; Tue, 15 Feb 2022 11:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644952865; cv=none; d=google.com; s=arc-20160816; b=SGGGNE2gghALmh4qWgM8gX8v1ineA6CZDRkp6wX/VjtJnT/GU0ujuxLAq1B1gRyC4j cXnzOOv8NfRvD9UC77M4LCUgkz0h3Jt4hSnUXQCiAJwJ1iedNx+Ws2kOv8si/jb5P8u8 AHhnVfWle/fvBbQrYMZx57XUUXNI1L8N/8N262t2l3mA6+KsJb6TBg2xijsFAHtobnSo YEtcXg39vLeVEDjn0C5RdvJFJ0WTSlq3tLYSsLXhNK6FMMYHTvOws5Kw2ZwF6sdIqTol JURrQNBT2tsIjLTuPnPSBPMXA3CFfiQSImI0A8FnPXE1FazWqXqtLZWfKNALto0VLBC7 242A== 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; bh=Z4jMmcrSmwkndlEL/eNoUrUW0VvAJRZFE9JNTIv003Y=; b=KbzhpAtdKbRHBIuWsO47uXOVzNIa8suOG1pVJFUFos5D0pmJz71SrTRif5eAesRuMN DEHECpREtOsixcsnk/ATjikC3LALBAdAmc7Voh/zjmWieLM2xFBtJ29tVbcxBkiz8hoB rjxFqksiBV9OnciJjXw99Wm7/iOvZfbSpX6scklTvaU9M2f0AsG7ol361aU4jYaNp3ar 6NsFrPff2nFgnFu2pT9Mlhqhsn5dhHcA5te8B9CsN1imvLv35fmCvhOg7yQk/1ShQtLB tZHAQJEQjsm3INJ+ywkr19ipt2ZuN7RljF1H0grCR1jSQAeHwUraVqVg3Wj0Iqqs9cNP J67g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12si3236449pfk.259.2022.02.15.11.20.48; Tue, 15 Feb 2022 11:21:05 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241985AbiBOQxO (ORCPT + 99 others); Tue, 15 Feb 2022 11:53:14 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241902AbiBOQwr (ORCPT ); Tue, 15 Feb 2022 11:52:47 -0500 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 691A89ADB5 for ; Tue, 15 Feb 2022 08:52:33 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:7534:e0be:5adf:2691]) by albert.telenet-ops.be with bizsmtp id vUsV2600718GbK106UsVLq; Tue, 15 Feb 2022 17:52:31 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nK140-000tUj-RY; Tue, 15 Feb 2022 17:52:28 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1nK13z-00BURL-Tk; Tue, 15 Feb 2022 17:52:27 +0100 From: Geert Uytterhoeven To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Helge Deller , Javier Martinez Canillas Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 0/8] drm: Add support for low-color frame buffer formats Date: Tue, 15 Feb 2022 17:52:18 +0100 Message-Id: <20220215165226.2738568-1-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, A long outstanding issue with the DRM subsystem has been the lack of support for low-color displays, as used typically on older desktop systems and small embedded displays. This patch series adds support for color-indexed frame buffer formats with 2, 4, and 16 colors. It has been tested on ARAnyM using a work-in-progress Atari DRM driver, with text console operation and fbtest. Overview: - Patches 1 and 2 give a working system, albeit with a too large pitch (line length), - Patches 3 and 4 reduce memory consumption by correcting the pitch in case bpp < 8, - Patches 5 and 6 are untested, but may become useful with DRM userspace, - Patches 7 and 8 add more fourcc codes for grayscale and monochrome frame buffer formats, which may be useful for e.g. the ssd130x and repaper drivers. Notes: - I haven't looked yet into making modetest draw a correct image. - As this was used on emulated hardware only, and I do not have Atari hardware, I do not have performance figures to compare with fbdev. I hope to do proper measuring with an Amiga DRM driver, eventually. Thanks for your comments! Geert Uytterhoeven (8): drm/fourcc: Add DRM_FORMAT_C[124] drm/fb-helper: Add support for DRM_FORMAT_C[124] drm/fourcc: Add drm_format_info_bpp() helper drm/client: Use actual bpp when allocating frame buffers drm/framebuffer: Use actual bpp for DRM_IOCTL_MODE_GETFB drm/gem-fb-helper: Use actual bpp for size calculations drm/fourcc: Add DRM_FORMAT_R[124] drm/fourcc: Add DRM_FORMAT_D1 drivers/gpu/drm/drm_client.c | 4 +- drivers/gpu/drm/drm_fb_helper.c | 120 ++++++++++++++----- drivers/gpu/drm/drm_fourcc.c | 45 +++++++ drivers/gpu/drm/drm_framebuffer.c | 2 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 12 +- include/drm/drm_fourcc.h | 1 + include/uapi/drm/drm_fourcc.h | 15 +++ 7 files changed, 160 insertions(+), 39 deletions(-) -- 2.25.1 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds