mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Carlos Alberto <carlosalberto4ti@gmail.com>
To: gregkh@linuxfoundation.org
Cc: mchehab@kernel.org, hverkuil@xs4all.nl,
	patrik.r.jakobsson@gmail.com, linux-media@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	carlosalberto4ti@gmail.com
Subject: [PATCH 0/2] staging: media: facetimehd: add driver for Apple FaceTime HD camera
Date: Fri,  6 Nov 2026 17:43:27 -0300	[thread overview]
Message-ID: <20261106204329.2176266-1-carlosalberto4ti@gmail.com> (raw)

This patch series introduces the facetimehd driver to drivers/staging/media/.
The driver supports the Broadcom BCM1570 (PCI ID 14e4:1570) PCIe Image Signal
Processor found in Apple MacBook Pro, MacBook Air, and iMac machines (spanning
generations from 2013 to 2019).

Historically, this driver remained out-of-tree primarily because it lacked a
redistributable firmware binary and relied on extracting proprietary blobs from
macOS recovery packages. We have addressed this blocker by developing OpenFTHD,
a 100% clean-room, open-source firmware (GPL-2.0-only) written in freestanding
C and bare-metal embedded Rust. A separate patch for linux-firmware adds
facetimehd/firmware.bin.

Key capabilities included in this submission:
- Modern V4L2 and videobuf2-dma-sg implementation compatible with Linux 6.12+
  through 7.0+ (removal of deprecated vb2 callbacks).
- Seamless PipeWire and Flatpak streaming via in-page USERPTR offset support
  (programming obj->byte_offset into ISP DMA descriptors) and chained scatterlist
  iteration with for_each_sg().
- Discrete framesize enumeration (1080p, 720p, VGA, QVGA) and matching
  discrete frameintervals for WebRTC, PipeWire, OBS, and browser capture.
- Native V4L2_PIX_FMT_YUYV pixel pipeline with power-of-two 8-pixel macroblock
  stride alignment and immediate Auto White Balance (AWB) on channel start.
- Hardware ePTZ digital zoom (VIDIOC_G_SELECTION / VIDIOC_S_SELECTION for
  V4L2_SEL_TGT_CROP), executing lossless sensor crop without host CPU overhead.
- Auto-Exposure Photometry Metering (V4L2_CID_EXPOSURE_METERING: Average,
  Center-Weighted, Spot, Matrix).
- Wide Dynamic Range / HDR (V4L2_CID_WIDE_DYNAMIC_RANGE) tone adaptation.
- Camera status / privacy indicator LED control (V4L2_CID_ILLUMINATORS_1).
- Runtime module parameters and power profiles (High Performance, Balanced,
  Aggressive Low Power sensor sleep) exposed under /sys/module/facetimehd/parameters/.

The driver has been validated on physical hardware (MacBook Pro Retina 15-inch
Mid 2014, MacBookPro11,2, PCI 03:00.0) running Linux 7.0.0-14-generic,
streaming cleanly at a steady 30.0 fps in both native V4L2 and PipeWire
(GNOME Cheese / Snapshot in Flatpak containers) with zero dropped frames.

Repository & Upstream Pull Request References:
- Out-of-tree repository: https://github.com/patjak/facetimehd
- Tracking Pull Request: https://github.com/patjak/facetimehd/pull/368
- Active branch with test suite: https://github.com/programandosolucoes/facetimehd/tree/linux-6.12-compat
- OpenFTHD clean-room firmware: https://github.com/programandosolucoes/open-fthd-firmware

A TODO file is provided detailing the roadmap for graduating from staging
into drivers/media/pci/facetimehd/.

Carlos Alberto (2):
  staging: media: facetimehd: add driver for Apple FaceTime HD (BCM1570)
    PCIe camera
  staging: media: wire up facetimehd in Kconfig and Makefile

 drivers/staging/media/Kconfig                 |    1 +
 drivers/staging/media/Makefile                |    1 +
 drivers/staging/media/facetimehd/Kconfig      |   16 +
 drivers/staging/media/facetimehd/Makefile     |    5 +
 drivers/staging/media/facetimehd/TODO         |   18 +
 .../staging/media/facetimehd/fthd_buffer.c    |  125 ++
 .../staging/media/facetimehd/fthd_buffer.h    |   73 +
 drivers/staging/media/facetimehd/fthd_ddr.c   |  670 ++++++++
 drivers/staging/media/facetimehd/fthd_ddr.h   |   30 +
 .../staging/media/facetimehd/fthd_debugfs.c   |  198 +++
 .../staging/media/facetimehd/fthd_debugfs.h   |   17 +
 drivers/staging/media/facetimehd/fthd_drv.c   |  600 +++++++
 drivers/staging/media/facetimehd/fthd_drv.h   |  133 ++
 drivers/staging/media/facetimehd/fthd_hw.c    |  712 ++++++++
 drivers/staging/media/facetimehd/fthd_hw.h    |  128 ++
 drivers/staging/media/facetimehd/fthd_isp.c   | 1483 +++++++++++++++++
 drivers/staging/media/facetimehd/fthd_isp.h   |  768 +++++++++
 drivers/staging/media/facetimehd/fthd_reg.h   |  184 ++
 .../staging/media/facetimehd/fthd_ringbuf.c   |  135 ++
 .../staging/media/facetimehd/fthd_ringbuf.h   |   44 +
 drivers/staging/media/facetimehd/fthd_v4l2.c  |  881 ++++++++++
 drivers/staging/media/facetimehd/fthd_v4l2.h  |   34 +
 22 files changed, 6256 insertions(+)
 create mode 100644 drivers/staging/media/facetimehd/Kconfig
 create mode 100644 drivers/staging/media/facetimehd/Makefile
 create mode 100644 drivers/staging/media/facetimehd/TODO
 create mode 100644 drivers/staging/media/facetimehd/fthd_buffer.c
 create mode 100644 drivers/staging/media/facetimehd/fthd_buffer.h
 create mode 100644 drivers/staging/media/facetimehd/fthd_ddr.c
 create mode 100644 drivers/staging/media/facetimehd/fthd_ddr.h
 create mode 100644 drivers/staging/media/facetimehd/fthd_debugfs.c
 create mode 100644 drivers/staging/media/facetimehd/fthd_debugfs.h
 create mode 100644 drivers/staging/media/facetimehd/fthd_drv.c
 create mode 100644 drivers/staging/media/facetimehd/fthd_drv.h
 create mode 100644 drivers/staging/media/facetimehd/fthd_hw.c
 create mode 100644 drivers/staging/media/facetimehd/fthd_hw.h
 create mode 100644 drivers/staging/media/facetimehd/fthd_isp.c
 create mode 100644 drivers/staging/media/facetimehd/fthd_isp.h
 create mode 100644 drivers/staging/media/facetimehd/fthd_reg.h
 create mode 100644 drivers/staging/media/facetimehd/fthd_ringbuf.c
 create mode 100644 drivers/staging/media/facetimehd/fthd_ringbuf.h
 create mode 100644 drivers/staging/media/facetimehd/fthd_v4l2.c
 create mode 100644 drivers/staging/media/facetimehd/fthd_v4l2.h

-- 
2.53.0


             reply	other threads:[~2026-11-06 20:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 20:43 Carlos Alberto [this message]
2026-11-06 20:43 ` [PATCH] staging: media: facetimehd: add driver for Apple FaceTime HD (BCM1570) PCIe camera Carlos Alberto
2026-11-06 20:43 ` [PATCH 2/2] staging: media: wire up facetimehd in Kconfig and Makefile Carlos Alberto

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=20261106204329.2176266-1-carlosalberto4ti@gmail.com \
    --to=carlosalberto4ti@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=patrik.r.jakobsson@gmail.com \
    /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®