Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions Documentation/devicetree/bindings/display/panel/google,hk3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/panel/google,hk3.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Google HK3 AMOLED DSI panel

description:
The HK3 is the 1344x2992 command-mode AMOLED panel of the Google Pixel
8 Pro. It takes DSC 1.2 compressed pixel data (two 672x187 slices at 8
bits per pixel) over four MIPI DSI lanes, reports its refresh timing on
a tearing effect (TE) line and runs at 60 or 120 Hz.

maintainers:
- Brett-Michael Green <brett@bmgvisualtech.com>

allOf:
- $ref: panel-common.yaml#

properties:
compatible:
const: google,hk3

reg:
maxItems: 1

reset-gpios: true

vddi-supply:
description: I/O supply

vddd-supply:
description: Digital core supply

vci-supply:
description: Analog supply

required:
- compatible
- reg

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>

dsi {
#address-cells = <1>;
#size-cells = <0>;

panel@0 {
compatible = "google,hk3";
reg = <0>;
reset-gpios = <&gpp0 0 GPIO_ACTIVE_LOW>;
vci-supply = <&vci>;
vddi-supply = <&vddi>;
vddd-supply = <&vddd>;
};
};

...
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ maintainers:
- Derek Ross <derekross@gmail.com>

description:
The DECON is the display controller of the gs201 (Tensor G2) and zumapro
(Tensor G4) display pipelines. It blends up to six or fourteen windows,
respectively, each fed by a DPP read DMA
The DECON is the display controller of the gs201 (Tensor G2), zuma
(Tensor G3) and zumapro (Tensor G4) display pipelines. It blends up to
six (gs201) or fourteen windows, each fed by a DPP read DMA
channel, compresses the result with DSC and hands it to a DSIM. In
command mode a frame is sent on each tearing effect (TE) pulse of the
panel; register writes are double-buffered and take effect at the
Expand All @@ -22,6 +22,7 @@ properties:
compatible:
enum:
- google,gs201-decon
- google,zuma-decon
- google,zumapro-decon

reg:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ description:
pipeline. It takes pixel data from a DECON and drives up to four data
lanes through a combined D-PHY/C-PHY, in video or command mode, with
DSC slice packing and TE-based command scheduling. Panels are described
as child nodes. The Tensor G4 (zumapro) has the same DSIM, at the same
register layout.
as child nodes. The Tensor G3 (zuma) and Tensor G4 (zumapro) have the
same DSIM, at the same register layout.

allOf:
- $ref: /schemas/display/dsi-controller.yaml#
Expand All @@ -25,7 +25,9 @@ properties:
oneOf:
- const: google,gs201-dsim
- items:
- const: google,zumapro-dsim
- enum:
- google,zuma-dsim
- google,zumapro-dsim
- const: google,gs201-dsim

reg:
Expand Down
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -8148,6 +8148,12 @@ T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
F: drivers/gpu/drm/gud/
F: include/drm/gud.h

DRM DRIVER FOR GOOGLE HK3 PANELS
M: Brett-Michael Green <brett@bmgvisualtech.com>
S: Maintained
F: Documentation/devicetree/bindings/display/panel/google,hk3.yaml
F: drivers/gpu/drm/panel/panel-google-hk3.c

DRM DRIVER FOR GOOGLE TG4C PANELS
M: W4HO <87742609+W4HO-ham@users.noreply.github.com>
S: Maintained
Expand Down
45 changes: 45 additions & 0 deletions arch/arm64/boot/dts/exynos/google/zuma-husky.dts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@
no-map;
};

/*
* DECON's scanout buffers, below 4 GiB for DPP0's 32-bit DMA,
* in RAM that stock leaves free.
*/
display_pool: display-pool {
compatible = "shared-dma-pool";
reusable;
size = <0x04000000>;
alignment = <0x0 0x00200000>;
alloc-ranges = <0x0 0xc4000000 0x10000000>;
};

/*
* All of the Wi-Fi chip's DMA buffers come from this pool, below
* 4 GiB, as on the Pixel 7 Pro: it keeps driver bugs and stray
Expand Down Expand Up @@ -207,6 +219,39 @@
};
};

/*
* DECON0 takes the display over from simple-framebuffer and flips DPP0
* between scanout buffers. It scans out to DSIM0, so gs-decon can switch
* the link and the panel between 60 and 120 Hz.
*/
&decon0 {
memory-region = <&display_pool>, <&cont_splash_mem>;
memory-region-names = "pool", "boot-framebuffer";
status = "okay";

port {
decon0_out: endpoint {
remote-endpoint = <&dsi0_in>;
};
};
};

/* The HK3, running as the bootloader left it: no reset or supply control. */
&dsi0 {
status = "okay";

panel@0 {
compatible = "google,hk3";
reg = <0>;
};

port {
dsi0_in: endpoint {
remote-endpoint = <&decon0_out>;
};
};
};

/*
* Wi-Fi: the BCM4398 on pcie_1, one Gen3 lane as on stock. Its DMA
* buffers come from wifi_dma_pool.
Expand Down
23 changes: 23 additions & 0 deletions arch/arm64/boot/dts/exynos/google/zuma.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,29 @@
};
};

dsi0: dsi@19440000 {
compatible = "google,zuma-dsim", "google,gs201-dsim";
reg = <0x19440000 0x300>, <0x19460100 0x700>,
<0x19460000 0x100>;
reg-names = "dsi", "dphy", "dphy-extra";
interrupts = <GIC_SPI 252 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};

/* Scans out what the bootloader set up; no panel or clock control. */
decon0: display-controller@19470000 {
compatible = "google,zuma-decon";
reg = <0x19470000 0x2000>, <0x19900000 0x1000>;
reg-names = "main", "dma";
interrupts = <GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 242 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 241 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "frame_start", "frame_done", "extra";
status = "disabled";
};

cmu_top: clock-controller@26040000 {
compatible = "google,zuma-cmu-top";
reg = <0x26040000 0x8000>;
Expand Down
43 changes: 41 additions & 2 deletions drivers/gpu/drm/google/gs-decon.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
*
* Register layout from Google's GPL display driver
* (google-modules/display/samsung/cal_9845/regs-decon.h and regs-dpp.h),
* which gs201 shares with gs101. G4 offsets and the fourteen-window mask
* follow cal_9865/regs-decon.h and regs-dpp.h in the same GPL driver.
* which gs201 shares with gs101. G3 and G4 offsets and the fourteen-window
* mask follow cal_9865/regs-decon.h and regs-dpp.h in the same GPL driver,
* which builds that CAL for both.
*/

#include <linux/aperture.h>
Expand Down Expand Up @@ -232,6 +233,30 @@ static const struct drm_display_mode tegu_decon_modes[] = {
TEGU_DECON_MODE(120),
};

/*
* The Pixel 8 Pro's HK3 at 1344x2992, from panel-gs-hk3.c, at 60 Hz (the
* bootloader's) and 120 Hz.
*/
#define HK3_DECON_MODE(hz) { \
.clock = (1344 + 80 + 24 + 42) * (2992 + 12 + 4 + 22) * (hz) / 1000, \
.hdisplay = 1344, \
.hsync_start = 1344 + 80, \
.hsync_end = 1344 + 80 + 24, \
.htotal = 1344 + 80 + 24 + 42, \
.vdisplay = 2992, \
.vsync_start = 2992 + 12, \
.vsync_end = 2992 + 12 + 4, \
.vtotal = 2992 + 12 + 4 + 22, \
.width_mm = 70, \
.height_mm = 155, \
.type = DRM_MODE_TYPE_DRIVER, \
}

static const struct drm_display_mode hk3_decon_modes[] = {
HK3_DECON_MODE(60),
HK3_DECON_MODE(120),
};

struct gs_decon_soc_data {
const struct drm_display_mode *modes;
unsigned int num_modes;
Expand Down Expand Up @@ -265,6 +290,19 @@ static const struct gs_decon_soc_data zumapro_decon_data = {
.floors_optional = true,
};

/* G3 shares G4's CAL (cal_9865) and DECON0 registers. */
static const struct gs_decon_soc_data zuma_decon_data = {
.modes = hk3_decon_modes,
.num_modes = ARRAY_SIZE(hk3_decon_modes),
.image_size_reg = 0x001c,
.source_offset_reg = 0x0018,
.shadow_update_mask = SHD_REG_UP_REQ_FLIP(0x3fff),
.separate_source_height = true,
.padded_pitch = true,
.start_hw_trigger = true,
.floors_optional = true,
};

#define GS_DECON_BOOT_HZ 60

struct gs_decon {
Expand Down Expand Up @@ -1542,6 +1580,7 @@ static void gs_decon_shutdown(struct platform_device *pdev)

static const struct of_device_id gs_decon_of_match[] = {
{ .compatible = "google,gs201-decon", .data = &gs201_decon_data },
{ .compatible = "google,zuma-decon", .data = &zuma_decon_data },
{ .compatible = "google,zumapro-decon", .data = &zumapro_decon_data },
{ /* sentinel */ }
};
Expand Down
10 changes: 10 additions & 0 deletions drivers/gpu/drm/google/gs-dsim-cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ static const struct gs_dsim_rate gs_dsim_rates[][2] = {
{ .hz = 60, .underrun = 0x18c8, .te_ctrl1 = 0x2a82306d },
{ .hz = 120, .underrun = 0x02a0, .te_ctrl1 = 0x15411836 },
},
/*
* Pixel 8 Pro, HK3: 4 lanes at 1368 Mbit/s (word clock 85.5 MHz),
* DSC 3:1, 1344x2992, TE idle 350 us. Google's dsim_calc_underrun()
* gives the bootloader's 60 Hz value exactly at that rate, so the
* 120 Hz one is the formula's too.
*/
{
{ .hz = 60, .underrun = 0x2235, .te_ctrl1 = 0x34c53c1e },
{ .hz = 120, .underrun = 0x06a7, .te_ctrl1 = 0x1a621e0f },
},
};

struct gs_dsim {
Expand Down
12 changes: 12 additions & 0 deletions drivers/gpu/drm/panel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ config DRM_PANEL_DSI_CM
DRM panel driver for DSI command mode panels with support for
embedded and external backlights.

config DRM_PANEL_GOOGLE_HK3
tristate "Google HK3 DSI command mode panel"
depends on OF
depends on DRM_MIPI_DSI
depends on BACKLIGHT_CLASS_DEVICE
help
Say Y or M here if you want to enable support for the Google
HK3 1344x2992 command-mode AMOLED panel, found in the Google
Pixel 8 Pro. The driver takes over the panel the bootloader left
running, switches it between 60 and 120 Hz, puts it to sleep and
exposes its brightness as a backlight.

config DRM_PANEL_GOOGLE_TG4C
tristate "Google TG4C DSI command mode panel"
depends on OF
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/panel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) += panel-boe-tv101wum-nl6.o
obj-$(CONFIG_DRM_PANEL_CHIPONE_ICNA35XX) += panel-chipone-icna35xx.o
obj-$(CONFIG_DRM_PANEL_CHIPWEALTH_CH13726A) += panel-chipwealth-ch13726a.o
obj-$(CONFIG_DRM_PANEL_DSI_CM) += panel-dsi-cm.o
obj-$(CONFIG_DRM_PANEL_GOOGLE_HK3) += panel-google-hk3.o
obj-$(CONFIG_DRM_PANEL_GOOGLE_TG4C) += panel-google-tg4c.o
obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
Expand Down
Loading