Skip to content

Commit bfda9aa

Browse files
committed
Merge tag 'drm-misc-next-2017-06-15' of git://anongit.freedesktop.org/git/drm-misc into drm-next
Cross-subsystem Changes: - dt-bindings: add vendor prefix for NLT Technologies, Ltd. (Lucas) - dt-bindings: Add support for samsung s6e3hf2 panel (Hoegeun) Core Changes: - Add drm_panel_bridge to avoid connector boilerplate in drivers (Eric) - Trival fixes for dupe forward decl and reduce scope of variable (Dawid) Driver Changes: - dw-hdmi: Use mode_valid hook on bridge instead of connector (Jose) - vc4,atmel-hlcdc: Use drm_panel_bridge where appropriate (Eric) - panel: Add Innolux P079ZCA panel driver (Chris) - panel-simple: Add NL12880B20-05, NL192108AC18-02D, P320HVN03 panels (Lucas) - panel-samsung-s6e3ha2: Add s6e3hf2 panel support (Hoegeun) - zte,vc4,pl111,panel,mxsfb: Miscellaneous fixes Cc: Jose Abreu <Jose.Abreu@synopsys.com> Cc: Eric Anholt <eric@anholt.net> Cc: Chris Zhong <zyw@rock-chips.com> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Hoegeun Kwon <hoegeun.kwon@samsung.com> Cc: Dawid Kurek <dawikur@gmail.com> * tag 'drm-misc-next-2017-06-15' of git://anongit.freedesktop.org/git/drm-misc: (26 commits) drm: Reduce scope of 'state' variable drm: mxsfb_crtc: Reset the eLCDIF controller drm: Remove duplicate forward declaration drm/panel: s6e3ha2: Add support for s6e3hf2 panel on TM2e board dt-bindings: Add support for samsung s6e3hf2 panel drm/panel: add backlight dependency for sitronix-st7789v drm/panel: S6E3HA2 needs backlight code drm/panel: simple: add support for AUO P320HVN03 drm/panel: simple: add support for NLT NL192108AC18-02D dt-bindings: add vendor prefix for NLT Technologies, Ltd. drm/panel: simple: add support for NEC NL12880B20-05 drm/panel: add Innolux P079ZCA panel driver dt-bindings: Add INNOLUX P079ZCA panel bindings drm/vc4: Fix resource leak in 'vc4_get_hang_state_ioctl()' in error handling path drm/vc4/vc4_bo.c: always set bo->resv drm: Add const to name field declaration in struct drm_prop_enum_list drm/pl111: Fix offset calculation for the primary plane. drm/atmel-hlcdc: Fix panel registration drm/bridge: Build the panel wrapper in drm_kms_helper drm/atmel-hlcdc: Replace the panel usage with drm_panel_bridge. ...
2 parents 3ee45a3 + ac7c748 commit bfda9aa

34 files changed

Lines changed: 944 additions & 643 deletions
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
AU Optronics Corporation 31.5" FHD (1920x1080) TFT LCD panel
2+
3+
Required properties:
4+
- compatible: should be "auo,p320hvn03"
5+
- power-supply: as specified in the base binding
6+
7+
This binding is compatible with the simple-panel binding, which is specified
8+
in simple-panel.txt in this directory.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Innolux P079ZCA 7.85" 768x1024 TFT LCD panel
2+
3+
Required properties:
4+
- compatible: should be "innolux,p079zca"
5+
- reg: DSI virtual channel of the peripheral
6+
- power-supply: phandle of the regulator that provides the supply voltage
7+
- enable-gpios: panel enable gpio
8+
9+
Optional properties:
10+
- backlight: phandle of the backlight device attached to the panel
11+
12+
Example:
13+
14+
&mipi_dsi {
15+
panel {
16+
compatible = "innolux,p079zca";
17+
reg = <0>;
18+
power-supply = <...>;
19+
backlight = <&backlight>;
20+
enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
21+
status = "okay";
22+
};
23+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
NEC LCD Technologies, Ltd. 12.1" WXGA (1280x800) LVDS TFT LCD panel
2+
3+
Required properties:
4+
- compatible: should be "nec,nl12880bc20-05"
5+
- power-supply: as specified in the base binding
6+
7+
This binding is compatible with the simple-panel binding, which is specified
8+
in simple-panel.txt in this directory.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
NLT Technologies, Ltd. 15.6" FHD (1920x1080) LVDS TFT LCD panel
2+
3+
Required properties:
4+
- compatible: should be "nlt,nl192108ac18-02d"
5+
- power-supply: as specified in the base binding
6+
7+
This binding is compatible with the simple-panel binding, which is specified
8+
in simple-panel.txt in this directory.

‎Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2.txt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
Samsung S6E3HA2 5.7" 1440x2560 AMOLED panel
2+
Samsung S6E3HF2 5.65" 1600x2560 AMOLED panel
23

34
Required properties:
4-
- compatible: "samsung,s6e3ha2"
5+
- compatible: should be one of:
6+
"samsung,s6e3ha2",
7+
"samsung,s6e3hf2".
58
- reg: the virtual channel number of a DSI peripheral
69
- vdd3-supply: I/O voltage supply
710
- vci-supply: voltage supply for analog circuits

‎Documentation/devicetree/bindings/vendor-prefixes.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ nexbox Nexbox
219219
newhaven Newhaven Display International
220220
ni National Instruments
221221
nintendo Nintendo
222+
nlt NLT Technologies, Ltd.
222223
nokia Nokia
223224
nordic Nordic Semiconductor
224225
nuvoton Nuvoton Technology Corporation

‎Documentation/gpu/drm-kms-helpers.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ Bridge Helper Reference
143143
.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
144144
:export:
145145

146+
Panel-Bridge Helper Reference
147+
-----------------------------
148+
149+
.. kernel-doc:: drivers/gpu/drm/bridge/panel.c
150+
:export:
151+
146152
.. _drm_panel_helper:
147153

148154
Panel Helper Reference

‎drivers/gpu/drm/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o \
3535
drm_simple_kms_helper.o drm_modeset_helper.o \
3636
drm_scdc_helper.o
3737

38+
drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o
3839
drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
3940
drm_kms_helper-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fb_helper.o
4041
drm_kms_helper-$(CONFIG_DRM_KMS_CMA_HELPER) += drm_fb_cma_helper.o

‎drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c‎

Lines changed: 15 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -23,139 +23,17 @@
2323

2424
#include <drm/drmP.h>
2525
#include <drm/drm_of.h>
26+
#include <drm/drm_bridge.h>
2627

2728
#include "atmel_hlcdc_dc.h"
2829

29-
/**
30-
* Atmel HLCDC RGB connector structure
31-
*
32-
* This structure stores RGB slave device information.
33-
*
34-
* @connector: DRM connector
35-
* @encoder: DRM encoder
36-
* @dc: pointer to the atmel_hlcdc_dc structure
37-
* @panel: panel connected on the RGB output
38-
*/
39-
struct atmel_hlcdc_rgb_output {
40-
struct drm_connector connector;
41-
struct drm_encoder encoder;
42-
struct atmel_hlcdc_dc *dc;
43-
struct drm_panel *panel;
44-
};
45-
46-
static inline struct atmel_hlcdc_rgb_output *
47-
drm_connector_to_atmel_hlcdc_rgb_output(struct drm_connector *connector)
48-
{
49-
return container_of(connector, struct atmel_hlcdc_rgb_output,
50-
connector);
51-
}
52-
53-
static inline struct atmel_hlcdc_rgb_output *
54-
drm_encoder_to_atmel_hlcdc_rgb_output(struct drm_encoder *encoder)
55-
{
56-
return container_of(encoder, struct atmel_hlcdc_rgb_output, encoder);
57-
}
58-
59-
static void atmel_hlcdc_rgb_encoder_enable(struct drm_encoder *encoder)
60-
{
61-
struct atmel_hlcdc_rgb_output *rgb =
62-
drm_encoder_to_atmel_hlcdc_rgb_output(encoder);
63-
64-
if (rgb->panel) {
65-
drm_panel_prepare(rgb->panel);
66-
drm_panel_enable(rgb->panel);
67-
}
68-
}
69-
70-
static void atmel_hlcdc_rgb_encoder_disable(struct drm_encoder *encoder)
71-
{
72-
struct atmel_hlcdc_rgb_output *rgb =
73-
drm_encoder_to_atmel_hlcdc_rgb_output(encoder);
74-
75-
if (rgb->panel) {
76-
drm_panel_disable(rgb->panel);
77-
drm_panel_unprepare(rgb->panel);
78-
}
79-
}
80-
81-
static const struct drm_encoder_helper_funcs atmel_hlcdc_panel_encoder_helper_funcs = {
82-
.disable = atmel_hlcdc_rgb_encoder_disable,
83-
.enable = atmel_hlcdc_rgb_encoder_enable,
84-
};
85-
86-
static void atmel_hlcdc_rgb_encoder_destroy(struct drm_encoder *encoder)
87-
{
88-
drm_encoder_cleanup(encoder);
89-
memset(encoder, 0, sizeof(*encoder));
90-
}
91-
9230
static const struct drm_encoder_funcs atmel_hlcdc_panel_encoder_funcs = {
93-
.destroy = atmel_hlcdc_rgb_encoder_destroy,
94-
};
95-
96-
static int atmel_hlcdc_panel_get_modes(struct drm_connector *connector)
97-
{
98-
struct atmel_hlcdc_rgb_output *rgb =
99-
drm_connector_to_atmel_hlcdc_rgb_output(connector);
100-
101-
if (rgb->panel)
102-
return rgb->panel->funcs->get_modes(rgb->panel);
103-
104-
return 0;
105-
}
106-
107-
static int atmel_hlcdc_rgb_mode_valid(struct drm_connector *connector,
108-
struct drm_display_mode *mode)
109-
{
110-
struct atmel_hlcdc_rgb_output *rgb =
111-
drm_connector_to_atmel_hlcdc_rgb_output(connector);
112-
113-
return atmel_hlcdc_dc_mode_valid(rgb->dc, mode);
114-
}
115-
116-
static const struct drm_connector_helper_funcs atmel_hlcdc_panel_connector_helper_funcs = {
117-
.get_modes = atmel_hlcdc_panel_get_modes,
118-
.mode_valid = atmel_hlcdc_rgb_mode_valid,
119-
};
120-
121-
static enum drm_connector_status
122-
atmel_hlcdc_panel_connector_detect(struct drm_connector *connector, bool force)
123-
{
124-
struct atmel_hlcdc_rgb_output *rgb =
125-
drm_connector_to_atmel_hlcdc_rgb_output(connector);
126-
127-
if (rgb->panel)
128-
return connector_status_connected;
129-
130-
return connector_status_disconnected;
131-
}
132-
133-
static void
134-
atmel_hlcdc_panel_connector_destroy(struct drm_connector *connector)
135-
{
136-
struct atmel_hlcdc_rgb_output *rgb =
137-
drm_connector_to_atmel_hlcdc_rgb_output(connector);
138-
139-
if (rgb->panel)
140-
drm_panel_detach(rgb->panel);
141-
142-
drm_connector_cleanup(connector);
143-
}
144-
145-
static const struct drm_connector_funcs atmel_hlcdc_panel_connector_funcs = {
146-
.dpms = drm_atomic_helper_connector_dpms,
147-
.detect = atmel_hlcdc_panel_connector_detect,
148-
.fill_modes = drm_helper_probe_single_connector_modes,
149-
.destroy = atmel_hlcdc_panel_connector_destroy,
150-
.reset = drm_atomic_helper_connector_reset,
151-
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
152-
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
31+
.destroy = drm_encoder_cleanup,
15332
};
15433

15534
static int atmel_hlcdc_attach_endpoint(struct drm_device *dev, int endpoint)
15635
{
157-
struct atmel_hlcdc_dc *dc = dev->dev_private;
158-
struct atmel_hlcdc_rgb_output *output;
36+
struct drm_encoder *encoder;
15937
struct drm_panel *panel;
16038
struct drm_bridge *bridge;
16139
int ret;
@@ -165,55 +43,34 @@ static int atmel_hlcdc_attach_endpoint(struct drm_device *dev, int endpoint)
16543
if (ret)
16644
return ret;
16745

168-
output = devm_kzalloc(dev->dev, sizeof(*output), GFP_KERNEL);
169-
if (!output)
46+
encoder = devm_kzalloc(dev->dev, sizeof(*encoder), GFP_KERNEL);
47+
if (!encoder)
17048
return -EINVAL;
17149

172-
output->dc = dc;
173-
174-
drm_encoder_helper_add(&output->encoder,
175-
&atmel_hlcdc_panel_encoder_helper_funcs);
176-
ret = drm_encoder_init(dev, &output->encoder,
50+
ret = drm_encoder_init(dev, encoder,
17751
&atmel_hlcdc_panel_encoder_funcs,
17852
DRM_MODE_ENCODER_NONE, NULL);
17953
if (ret)
18054
return ret;
18155

182-
output->encoder.possible_crtcs = 0x1;
56+
encoder->possible_crtcs = 0x1;
18357

18458
if (panel) {
185-
output->connector.dpms = DRM_MODE_DPMS_OFF;
186-
output->connector.polled = DRM_CONNECTOR_POLL_CONNECT;
187-
drm_connector_helper_add(&output->connector,
188-
&atmel_hlcdc_panel_connector_helper_funcs);
189-
ret = drm_connector_init(dev, &output->connector,
190-
&atmel_hlcdc_panel_connector_funcs,
191-
DRM_MODE_CONNECTOR_Unknown);
192-
if (ret)
193-
goto err_encoder_cleanup;
194-
195-
drm_mode_connector_attach_encoder(&output->connector,
196-
&output->encoder);
197-
198-
ret = drm_panel_attach(panel, &output->connector);
199-
if (ret) {
200-
drm_connector_cleanup(&output->connector);
201-
goto err_encoder_cleanup;
202-
}
203-
204-
output->panel = panel;
205-
206-
return 0;
59+
bridge = drm_panel_bridge_add(panel, DRM_MODE_CONNECTOR_Unknown);
60+
if (IS_ERR(bridge))
61+
return PTR_ERR(bridge);
20762
}
20863

20964
if (bridge) {
210-
ret = drm_bridge_attach(&output->encoder, bridge, NULL);
65+
ret = drm_bridge_attach(encoder, bridge, NULL);
21166
if (!ret)
21267
return 0;
68+
69+
if (panel)
70+
drm_panel_bridge_remove(bridge);
21371
}
21472

215-
err_encoder_cleanup:
216-
drm_encoder_cleanup(&output->encoder);
73+
drm_encoder_cleanup(encoder);
21774

21875
return ret;
21976
}

‎drivers/gpu/drm/bridge/Kconfig‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ config DRM_BRIDGE
44
help
55
Bridge registration and lookup framework.
66

7+
config DRM_PANEL_BRIDGE
8+
def_bool y
9+
depends on DRM_BRIDGE
10+
depends on DRM_KMS_HELPER
11+
select DRM_PANEL
12+
help
13+
DRM bridge wrapper of DRM panels
14+
715
menu "Display Interface Bridges"
816
depends on DRM && DRM_BRIDGE
917

@@ -27,8 +35,7 @@ config DRM_DUMB_VGA_DAC
2735
config DRM_LVDS_ENCODER
2836
tristate "Transparent parallel to LVDS encoder support"
2937
depends on OF
30-
select DRM_KMS_HELPER
31-
select DRM_PANEL
38+
select DRM_PANEL_BRIDGE
3239
help
3340
Support for transparent parallel to LVDS encoders that don't require
3441
any configuration.

0 commit comments

Comments
 (0)