mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aditya Garg <gargaditya08@live.com>
To: "maarten.lankhorst@linux.intel.com"
	<maarten.lankhorst@linux.intel.com>,
	"mripard@kernel.org" <mripard@kernel.org>,
	"tzimmermann@suse.de" <tzimmermann@suse.de>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"simona@ffwll.ch" <simona@ffwll.ch>,
	"andriy.shevchenko@linux.intel.com"
	<andriy.shevchenko@linux.intel.com>
Cc: Kerem Karabay <kekrby@gmail.com>,
	Atharva Tiwari <evepolonium@gmail.com>,
	Aun-Ali Zaidi <admin@kodeit.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v4 2/2] drm/tiny: add driver for Apple Touch Bars in x86 Macs
Date: Mon, 24 Feb 2025 16:58:48 +0000	[thread overview]
Message-ID: <PN3PR01MB95974D5EB5A25386A8BF6FDAB8C02@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <844C1D39-4891-4DC2-8458-F46FA1B59FA0@live.com>



> On 24 Feb 2025, at 7:10 PM, Aditya Garg <gargaditya08@live.com> wrote:
> 
> From: Kerem Karabay <kekrby@gmail.com>
> 
> The Touch Bars found on x86 Macs support two USB configurations: one
> where the device presents itself as a HID keyboard and can display
> predefined sets of keys, and one where the operating system has full
> control over what is displayed.
> 
> This commit adds support for the display functionality of the second
> configuration. Functionality for the first configuration has been
> merged in the HID tree.
> 
> Note that this driver has only been tested on T2 Macs, and only includes
> the USB device ID for these devices. Testing on T1 Macs would be
> appreciated.
> 
> Credit goes to Ben (Bingxing) Wang on GitHub for reverse engineering
> most of the protocol.
> 
> Also, as requested by Andy, I would like to clarify the use of __packed
> structs in this driver:
> 
> - All the packed structs are aligned except for appletbdrm_msg_information.
> - We have to pack appletbdrm_msg_information since it is requirement of
>  the protocol.
> - We compared binaries compiled by keeping the rest structs __packed and
>  not __packed using bloat-o-meter, and __packed was not affecting code
>  generation.
> - To maintain consistency, rest structs have been kept __packed.
> 
> Link: https://github.com/imbushuo/DFRDisplayKm
> Signed-off-by: Kerem Karabay <kekrby@gmail.com>
> Co-developed-by: Atharva Tiwari <evepolonium@gmail.com>
> Signed-off-by: Atharva Tiwari <evepolonium@gmail.com>
> Co-developed-by: Aditya Garg <gargaditya08@live.com>
> Signed-off-by: Aditya Garg <gargaditya08@live.com>
> Signed-off-by: Aun-Ali Zaidi <admin@kodeit.net>
> ---
> v2 ->
> - Add the driver to MAINTAINERS.
> - Allocate memory for request and response in plane's atomic-check helper
> - Void the use of drm_fb_blit()
> - Implement atomic_disable
> - Make PRIME work
> - Remove the date field from struct drm_driver
> - intersect damage with dst_clip
> - Register DRM device in appletbdrm_probe
> - Clear the display as the final call in probe
> - Select hid_multitouch as well in kconfig
> 
> v3 ->
> - Change commit message to credit Ben (Bingxing) Wang
> 
> v4 ->
> - Use "Link:" in commit message
> - Specify why __packed has been used in commit message
> - Use %p4cc instead of %p4ch for errors
> - Add myself to Maintainers
> - Remove #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> - Add missing header files
> - Use return 0; instead of return ret; in static int appletbdrm_send_request
> - Better errno types used in appletbdrm_read_response
> - Use BITS_TO_BYTES() to convert APPLETBDRM_BITS_PER_PIXEL to bytes
> - Remove redundant else in plane_helper_atomic_check
> - Remove unnecessary use of 0xff in request->msg_id = timestamp & 0xff;
> - Remove duplicated struct device in struct appletbdrm_device
> - clear frames_size and request_size as well in primary_plane_helper_atomic_update
> - Allocate using kzalloc instead of kmemdup
> - Use drm_err() instead of dev_err_probe()
> - Avoid clearing drm->mode_config.min_width and height to 0
> - Use put_device() to release the DMA device in appletbdrm_disconnect
> 
> MAINTAINERS                       |   8 +
> drivers/gpu/drm/tiny/Kconfig      |  14 +
> drivers/gpu/drm/tiny/Makefile     |   1 +
> drivers/gpu/drm/tiny/appletbdrm.c | 835 ++++++++++++++++++++++++++++++
> 4 files changed, 858 insertions(+)
> create mode 100644 drivers/gpu/drm/tiny/appletbdrm.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index efee40ea5..f7c97eb24 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7148,6 +7148,14 @@ S:    Supported
> T:    git https://gitlab.freedesktop.org/drm/misc/kernel.git
> F:    drivers/gpu/drm/sun4i/sun8i*
> 
> +DRM DRIVER FOR APPLE TOUCH BARS
> +M:    Aun-Ali Zaidi <admin@kodeit.net>
> +M:    Aditya Garg <gargaditya08@live.com>
> +L:    dri-devel@lists.freedesktop.org
> +S:    Maintained
> +T:    git https://gitlab.freedesktop.org/drm/misc/kernel.git
> +F:    drivers/gpu/drm/tiny/appletbdrm.c
> +
> DRM DRIVER FOR ARM PL111 CLCD
> M:    Linus Walleij <linus.walleij@linaro.org>
> S:    Maintained
> diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig
> index 94cbdb133..25471791c 100644
> --- a/drivers/gpu/drm/tiny/Kconfig
> +++ b/drivers/gpu/drm/tiny/Kconfig
> @@ -1,5 +1,19 @@
> # SPDX-License-Identifier: GPL-2.0-only
> 
> +config DRM_APPLETBDRM
> +    tristate "DRM support for Apple Touch Bars"
> +    depends on DRM && USB && MMU
> +    select DRM_GEM_SHMEM_HELPER
> +    select DRM_KMS_HELPER
> +    select HID_APPLETB_BL

Btw I have a doubt regarding this dependency. While hid-appletb-bl has made into the linux-next tree, it has still not been merged into Linus' tree, and neither the drm tree I assume. It potentially could cause issues?

> +    select HID_MULTITOUCH
> +    help
> +      Say Y here if you want support for the display of Touch Bars on x86
> +      MacBook Pros.
> +
> +      To compile this driver as a module, choose M here: the
> +      module will be called appletbdrm.
> +

  parent reply	other threads:[~2025-02-24 16:58 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 13:37 [PATCH v4 0/2] Touch Bar DRM driver for " Aditya Garg
2025-02-24 13:38 ` [PATCH v4 1/2] drm/format-helper: Add conversion from XRGB8888 to BGR888 Aditya Garg
2025-02-24 14:29   ` andriy.shevchenko
2025-02-24 14:54     ` Aditya Garg
2025-02-24 15:00       ` andriy.shevchenko
2025-02-24 15:03         ` Aditya Garg
2025-02-24 15:03         ` andriy.shevchenko
2025-02-25  7:37     ` Thomas Zimmermann
2025-02-25 10:24       ` andriy.shevchenko
2025-02-24 13:40 ` [PATCH v4 2/2] drm/tiny: add driver for Apple Touch Bars in x86 Macs Aditya Garg
2025-02-24 14:00   ` andriy.shevchenko
2025-02-24 14:32     ` Aditya Garg
2025-02-24 14:57       ` andriy.shevchenko
2025-02-24 15:03         ` Aditya Garg
2025-02-24 15:11           ` andriy.shevchenko
2025-02-24 15:20             ` Aditya Garg
2025-02-24 15:32               ` Aditya Garg
2025-02-24 15:38                 ` andriy.shevchenko
2025-02-24 15:40                   ` Aditya Garg
2025-02-24 15:52                     ` andriy.shevchenko
2025-02-24 15:56                       ` Aditya Garg
2025-02-24 16:14                         ` Aditya Garg
2025-02-24 16:14                         ` andriy.shevchenko
2025-02-24 16:38                           ` Aditya Garg
2025-02-24 15:36               ` andriy.shevchenko
2025-02-24 15:39                 ` Aditya Garg
2025-02-24 15:49                   ` andriy.shevchenko
2025-02-24 15:52                     ` Aditya Garg
2025-02-24 16:12                       ` andriy.shevchenko
2025-02-24 16:58   ` Aditya Garg [this message]
2025-02-25  7:56     ` Thomas Zimmermann
2025-02-25  8:02       ` Aditya Garg
2025-02-25  8:46         ` Thomas Zimmermann
2025-02-25  9:04       ` Aditya Garg
2025-02-25  9:07         ` Aditya Garg
2025-02-25  9:35           ` Thomas Zimmermann
2025-02-25  9:37             ` Aditya Garg
2025-02-25 10:01               ` Aditya Garg
2025-02-25  7:52   ` Thomas Zimmermann
2025-02-25  8:00     ` Aditya Garg
2025-02-25  8:48       ` Thomas Zimmermann
2025-02-25 10:28         ` andriy.shevchenko
2025-02-27 16:54   ` kernel test robot
2025-02-27 17:28     ` Aditya Garg
2025-02-28 12:25       ` andriy.shevchenko
2025-02-27 23:22   ` kernel test robot
2025-02-27 23:59   ` kernel test robot

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=PN3PR01MB95974D5EB5A25386A8BF6FDAB8C02@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM \
    --to=gargaditya08@live.com \
    --cc=admin@kodeit.net \
    --cc=airlied@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=evepolonium@gmail.com \
    --cc=kekrby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®