Skip to content
Open
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
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/samsung,s6e3fc5.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Samsung S6E3FC5 AMOLED DSI panel

description:
The S6E3FC5 is a display driver IC from Samsung Mobile Display, driving
the 1080x2400 command-mode AMOLED panel of the Google Pixel 7a. The panel
takes DSC-compressed pixel data over four MIPI DSI lanes and reports its
refresh timing on a tearing effect (TE) line.

maintainers:
- Derek Ross <derekross@gmail.com>
- cx3301J <cx3301J@users.noreply.github.com>

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

properties:
compatible:
const: samsung,s6e3fc5

reg:
maxItems: 1

reset-gpios: true

vci-supply:
description: Analog supply

vddi-supply:
description: I/O supply

required:
- compatible
- reg
- reset-gpios

unevaluatedProperties: false

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

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

panel@0 {
compatible = "samsung,s6e3fc5";
reg = <0>;
reset-gpios = <&gpa7 1 GPIO_ACTIVE_LOW>;
vci-supply = <&panel_vci>;
vddi-supply = <&panel_vddi>;
width-mm = <64>;
height-mm = <141>;
};
};

...
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -8498,6 +8498,12 @@ S: Maintained
F: Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml
F: drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c

DRM DRIVER FOR SAMSUNG S6E3FC5 PANELS
M: cx3301J <cx3301J@users.noreply.github.com>
S: Maintained
F: Documentation/devicetree/bindings/display/panel/samsung,s6e3fc5.yaml
F: drivers/gpu/drm/panel/panel-samsung-s6e3fc5.c

DRM DRIVER FOR SAMSUNG S6E3HC3 PANELS
M: saiththerobo <the.tom.sharp@gmail.com>
S: Maintained
Expand Down
61 changes: 59 additions & 2 deletions arch/arm64/boot/dts/exynos/google/gs201-lynx.dts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
/*
* ABL leaves DECON0 -> DSIM0 -> panel (sdc-s6e3fc5) running in
* command mode with DPP0 scanning 0xfac00000 (RDMA_BASEADDR_Y8,
* read on this phone). There is no panel driver, so no panel
* phandle; the size comes from this node.
* read on this phone). The panel driver is not a phandle here; the
* size comes from this node.
*/
framebuffer0: framebuffer@fac00000 {
compatible = "simple-framebuffer";
Expand All @@ -67,6 +67,29 @@
regulator-boot-on;
};

/*
* Panel rails: vci is S2MPG12 LDO27M and vddi is S2MPG13 BUCKA.
* Neither PMIC has a regulator driver yet, so these stay as the
* bootloader left them (always on, no control).
*/
panel_vddi: regulator-panel-vddi {
compatible = "regulator-fixed";
regulator-name = "panel-vddi";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
regulator-boot-on;
};

panel_vci: regulator-panel-vci {
compatible = "regulator-fixed";
regulator-name = "panel-vci";
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
regulator-always-on;
regulator-boot-on;
};

/*
* ABL adds sec_dram, sec_pt and pkvm_guest_firmware to this tree
* itself. Stock's tui, mfc_fw and famodel are pools the kernel
Expand All @@ -91,6 +114,19 @@
reg = <0x0 0xfac00000 (1080 * 2400 * 4)>;
no-map;
};

/*
* Scanout buffers for gs-decon. Inside the c3080000-d80fffff
* System RAM block from /proc/iomem on the phone; below 4 GiB
* because DPP0 takes 32-bit addresses.
*/
display_pool: display-pool {
compatible = "shared-dma-pool";
reusable;
size = <0x5c00000>;
alignment = <0x0 0x200000>;
alloc-ranges = <0x0 0xc4000000 0x5c00000>;
};
};
};

Expand Down Expand Up @@ -305,3 +341,24 @@
&usi_apm1 {
status = "okay";
};

&dsi0 {
status = "disabled";
panel: panel@0 {
compatible = "samsung,s6e3fc5";
reg = <0>;
reset-gpios = <&gpa7 1 GPIO_ACTIVE_LOW>;
vci-supply = <&panel_vci>;
vddi-supply = <&panel_vddi>;
width-mm = <64>;
height-mm = <141>;
};
};

&decon0 {
memory-region = <&display_pool>, <&cont_splash_mem>;
memory-region-names = "pool", "boot-framebuffer";
status = "disabled";
};

&gpu { status = "okay"; };
64 changes: 63 additions & 1 deletion drivers/gpu/drm/google/gs-decon.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ struct gs_decon_soc_data {
bool hold_boot_fb;
/* a VT switch around system sleep only with the fbdev console */
bool vt_switch_fbdev_only;
/* the panel driver owns the modes, not this table */
bool panel_modes;
};

static const struct gs_decon_soc_data gs201_decon_data = {
Expand Down Expand Up @@ -323,6 +325,37 @@ static const struct gs_decon_soc_data zuma_decon_data = {
.floors_optional = true,
};

/*
* Pixel 7a: 1080x2400, 32/12/26 horizontal and 12/4/26 vertical blanks.
* Same register layout as gs201_decon_data; only the mode differs.
*/
static const struct drm_display_mode gs201_lynx_decon_modes[] = {
{
.clock = (1080 + 32 + 12 + 26) * (2400 + 12 + 4 + 26) * 60 / 1000,
.hdisplay = 1080,
.hsync_start = 1080 + 32,
.hsync_end = 1080 + 32 + 12,
.htotal = 1080 + 32 + 12 + 26,
.vdisplay = 2400,
.vsync_start = 2400 + 12,
.vsync_end = 2400 + 12 + 4,
.vtotal = 2400 + 12 + 4 + 26,
.width_mm = 64,
.height_mm = 141,
.type = DRM_MODE_TYPE_DRIVER,
},
};

static const struct gs_decon_soc_data gs201_lynx_decon_data = {
.padded_pitch = true,
.modes = gs201_lynx_decon_modes,
.num_modes = ARRAY_SIZE(gs201_lynx_decon_modes),
.panel_modes = true,
.image_size_reg = RDMA_IMG_SIZE,
.source_offset_reg = RDMA_SRC_OFFSET,
.shadow_update_mask = SHD_REG_UP_REQ_FLIP(SHD_REG_UP_REQ_ALL_WIN),
};

#define GS_DECON_BOOT_HZ 60

struct gs_decon {
Expand Down Expand Up @@ -445,6 +478,20 @@ static void gs_decon_dump(struct gs_decon *dc)
readl(dc->dma + RDMA_SRC_HEIGHT_G4));
}

static void gs_decon_pick_lynx_soc(struct gs_decon *dc)
{
struct device_node *dsim, *panel;

dsim = of_graph_get_remote_node(dc->dev->of_node, 0, 0);
if (!dsim)
return;
panel = of_get_compatible_child(dsim, "samsung,s6e3fc5");
if (panel)
dc->soc = &gs201_lynx_decon_data;
of_node_put(panel);
of_node_put(dsim);
}

/*
* Checks that the pipeline is the one this driver knows how to drive:
* DECON on in command mode, DPP0 scanning a linear 8888 buffer, full
Expand Down Expand Up @@ -1129,8 +1176,22 @@ static const struct drm_crtc_funcs gs_decon_crtc_funcs = {
static int gs_decon_connector_get_modes(struct drm_connector *connector)
{
struct gs_decon *dc = drm_to_decon(connector->dev);
int i, count = 0;
int i, count;

if (dc->dsim && dc->soc->panel_modes) {
count = gs_dsim_panel_get_modes(dc->dsim, connector);
if (count > 0) {
struct drm_display_mode *mode;

mode = list_first_entry(&connector->probed_modes,
struct drm_display_mode, head);
connector->display_info.width_mm = mode->width_mm;
connector->display_info.height_mm = mode->height_mm;
return count;
}
}

count = 0;
for (i = 0; i < dc->soc->num_modes; i++) {
unsigned int hz = drm_mode_vrefresh(&dc->soc->modes[i]);
struct drm_display_mode *mode;
Expand Down Expand Up @@ -1437,6 +1498,7 @@ static int gs_decon_probe(struct platform_device *pdev)
dc->soc = device_get_match_data(dev);
if (!dc->soc)
return -ENODEV;
gs_decon_pick_lynx_soc(dc);
dc->hz = GS_DECON_BOOT_HZ;
dc->max_hz = GS_DECON_BOOT_HZ;
spin_lock_init(&dc->lock);
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 @@ -598,6 +598,16 @@ int gs_dsim_set_refresh_rate(struct gs_dsim *dsim, unsigned int hz)
}
EXPORT_SYMBOL_GPL(gs_dsim_set_refresh_rate);

int gs_dsim_panel_get_modes(struct gs_dsim *dsim,
struct drm_connector *connector)
{
if (!dsim->panel)
return 0;

return drm_panel_get_modes(dsim->panel, connector);
}
EXPORT_SYMBOL_GPL(gs_dsim_panel_get_modes);

/**
* gs_dsim_panel_sleep - switch the panel off and put it to sleep
* @dsim: the DSIM
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/google/gs-dsim.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ unsigned int gs_dsim_refresh_rate(struct gs_dsim *dsim);
bool gs_dsim_can_set_refresh_rate(struct gs_dsim *dsim, unsigned int hz);
int gs_dsim_set_refresh_rate(struct gs_dsim *dsim, unsigned int hz);

int gs_dsim_panel_get_modes(struct gs_dsim *dsim,
struct drm_connector *connector);
int gs_dsim_panel_sleep(struct gs_dsim *dsim);
int gs_dsim_panel_wake(struct gs_dsim *dsim, bool enable);

Expand Down
14 changes: 14 additions & 0 deletions drivers/gpu/drm/panel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,20 @@ config DRM_PANEL_SAMSUNG_S6E3HC3
left it running: the driver sends no initialisation sequence, and
the display modes come from the display controller's driver.

config DRM_PANEL_SAMSUNG_S6E3FC5
tristate "Samsung S6E3FC5 DSI panel"
depends on GPIOLIB
depends on OF
depends on DRM_MIPI_DSI
depends on BACKLIGHT_CLASS_DEVICE
select DRM_DISPLAY_HELPER
select DRM_DISPLAY_DSC_HELPER
help
Say Y here to enable support for the Samsung S6E3FC5 panel used
on the Pixel 7a (lynx). It is a command-mode AMOLED panel with
runtime DSC configuration and two refresh rates. To compile this
driver as a module, choose M here.

config DRM_PANEL_SAMSUNG_S6E3HC4
tristate "Samsung S6E3HC4 DSI command mode panel"
depends on GPIOLIB
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 @@ -105,6 +105,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8) += panel-samsung-s6e3ha8.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HC3) += panel-samsung-s6e3hc3.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HC4) += panel-samsung-s6e3hc4.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3FC5) += panel-samsung-s6e3fc5.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o
obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_SPI) += panel-samsung-s6e63m0-spi.o
Expand Down
Loading