Skip to content

Commit ca18e14

Browse files
committed
Merge branch 'tilcdc-next' of git://people.freedesktop.org/~robclark/linux into drm-next
KMS driver for TI LCD controller * 'tilcdc-next' of git://people.freedesktop.org/~robclark/linux: drm/tilcdc: add support for LCD panels (v5) drm/tilcdc: add encoder slave (v2) drm/i2c: nxp-tda998x (v3) drm/tilcdc: add TI LCD Controller DRM driver (v4) drm/nouveau: use i2c encoder helper wrappers drm: i2c encoder helper wrappers drm/cma: add debugfs helpers drm: small fix in drm_send_vblank_event() drm: Don't set the plane->fb to NULL on successfull set_plane drm/cma-helper: fixup compilation Conflicts: drivers/gpu/drm/Kconfig drivers/gpu/drm/Makefile drivers/gpu/drm/drm_fb_cma_helper.c
2 parents 74e1697 + 0d4bbaf commit ca18e14

29 files changed

Lines changed: 4066 additions & 26 deletions
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Device-Tree bindings for tilcdc DRM generic panel output driver
2+
3+
Required properties:
4+
- compatible: value should be "ti,tilcdc,panel".
5+
- panel-info: configuration info to configure LCDC correctly for the panel
6+
- ac-bias: AC Bias Pin Frequency
7+
- ac-bias-intrpt: AC Bias Pin Transitions per Interrupt
8+
- dma-burst-sz: DMA burst size
9+
- bpp: Bits per pixel
10+
- fdd: FIFO DMA Request Delay
11+
- sync-edge: Horizontal and Vertical Sync Edge: 0=rising 1=falling
12+
- sync-ctrl: Horizontal and Vertical Sync: Control: 0=ignore
13+
- raster-order: Raster Data Order Select: 1=Most-to-least 0=Least-to-most
14+
- fifo-th: DMA FIFO threshold
15+
- display-timings: typical videomode of lcd panel. Multiple video modes
16+
can be listed if the panel supports multiple timings, but the 'native-mode'
17+
should be the preferred/default resolution. Refer to
18+
Documentation/devicetree/bindings/video/display-timing.txt for display
19+
timing binding details.
20+
21+
Recommended properties:
22+
- pinctrl-names, pinctrl-0: the pincontrol settings to configure
23+
muxing properly for pins that connect to TFP410 device
24+
25+
Example:
26+
27+
/* Settings for CDTech_S035Q01 / LCD3 cape: */
28+
lcd3 {
29+
compatible = "ti,tilcdc,panel";
30+
pinctrl-names = "default";
31+
pinctrl-0 = <&bone_lcd3_cape_lcd_pins>;
32+
panel-info {
33+
ac-bias = <255>;
34+
ac-bias-intrpt = <0>;
35+
dma-burst-sz = <16>;
36+
bpp = <16>;
37+
fdd = <0x80>;
38+
sync-edge = <0>;
39+
sync-ctrl = <1>;
40+
raster-order = <0>;
41+
fifo-th = <0>;
42+
};
43+
display-timings {
44+
native-mode = <&timing0>;
45+
timing0: 320x240 {
46+
hactive = <320>;
47+
vactive = <240>;
48+
hback-porch = <21>;
49+
hfront-porch = <58>;
50+
hsync-len = <47>;
51+
vback-porch = <11>;
52+
vfront-porch = <23>;
53+
vsync-len = <2>;
54+
clock-frequency = <8000000>;
55+
hsync-active = <0>;
56+
vsync-active = <0>;
57+
};
58+
};
59+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Device-Tree bindings for tilcdc DRM encoder slave output driver
2+
3+
Required properties:
4+
- compatible: value should be "ti,tilcdc,slave".
5+
- i2c: the phandle for the i2c device the encoder slave is connected to
6+
7+
Recommended properties:
8+
- pinctrl-names, pinctrl-0: the pincontrol settings to configure
9+
muxing properly for pins that connect to TFP410 device
10+
11+
Example:
12+
13+
hdmi {
14+
compatible = "ti,tilcdc,slave";
15+
i2c = <&i2c0>;
16+
pinctrl-names = "default";
17+
pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
18+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Device-Tree bindings for tilcdc DRM TFP410 output driver
2+
3+
Required properties:
4+
- compatible: value should be "ti,tilcdc,tfp410".
5+
- i2c: the phandle for the i2c device to use for DDC
6+
7+
Recommended properties:
8+
- pinctrl-names, pinctrl-0: the pincontrol settings to configure
9+
muxing properly for pins that connect to TFP410 device
10+
- powerdn-gpio: the powerdown GPIO, pulled low to power down the
11+
TFP410 device (for DPMS_OFF)
12+
13+
Example:
14+
15+
dvicape {
16+
compatible = "ti,tilcdc,tfp410";
17+
i2c = <&i2c2>;
18+
pinctrl-names = "default";
19+
pinctrl-0 = <&bone_dvi_cape_dvi_00A1_pins>;
20+
powerdn-gpio = <&gpio2 31 0>;
21+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Device-Tree bindings for tilcdc DRM driver
2+
3+
Required properties:
4+
- compatible: value should be "ti,am33xx-tilcdc".
5+
- interrupts: the interrupt number
6+
- reg: base address and size of the LCDC device
7+
8+
Recommended properties:
9+
- interrupt-parent: the phandle for the interrupt controller that
10+
services interrupts for this device.
11+
- ti,hwmods: Name of the hwmod associated to the LCDC
12+
13+
Example:
14+
15+
fb: fb@4830e000 {
16+
compatible = "ti,am33xx-tilcdc";
17+
reg = <0x4830e000 0x1000>;
18+
interrupt-parent = <&intc>;
19+
interrupts = <36>;
20+
ti,hwmods = "lcdc";
21+
};

‎drivers/gpu/drm/Kconfig‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,5 @@ source "drivers/gpu/drm/shmobile/Kconfig"
217217
source "drivers/gpu/drm/tegra/Kconfig"
218218

219219
source "drivers/gpu/drm/omapdrm/Kconfig"
220+
221+
source "drivers/gpu/drm/tilcdc/Kconfig"

‎drivers/gpu/drm/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ obj-$(CONFIG_DRM_AST) += ast/
5151
obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/
5252
obj-$(CONFIG_DRM_TEGRA) += tegra/
5353
obj-$(CONFIG_DRM_OMAP) += omapdrm/
54+
obj-$(CONFIG_DRM_TILCDC) += tilcdc/
5455
obj-y += i2c/

‎drivers/gpu/drm/drm_encoder_slave.c‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,66 @@ void drm_i2c_encoder_destroy(struct drm_encoder *drm_encoder)
123123
module_put(module);
124124
}
125125
EXPORT_SYMBOL(drm_i2c_encoder_destroy);
126+
127+
/*
128+
* Wrapper fxns which can be plugged in to drm_encoder_helper_funcs:
129+
*/
130+
131+
static inline struct drm_encoder_slave_funcs *
132+
get_slave_funcs(struct drm_encoder *enc)
133+
{
134+
return to_encoder_slave(enc)->slave_funcs;
135+
}
136+
137+
void drm_i2c_encoder_dpms(struct drm_encoder *encoder, int mode)
138+
{
139+
get_slave_funcs(encoder)->dpms(encoder, mode);
140+
}
141+
EXPORT_SYMBOL(drm_i2c_encoder_dpms);
142+
143+
bool drm_i2c_encoder_mode_fixup(struct drm_encoder *encoder,
144+
const struct drm_display_mode *mode,
145+
struct drm_display_mode *adjusted_mode)
146+
{
147+
return get_slave_funcs(encoder)->mode_fixup(encoder, mode, adjusted_mode);
148+
}
149+
EXPORT_SYMBOL(drm_i2c_encoder_mode_fixup);
150+
151+
void drm_i2c_encoder_prepare(struct drm_encoder *encoder)
152+
{
153+
drm_i2c_encoder_dpms(encoder, DRM_MODE_DPMS_OFF);
154+
}
155+
EXPORT_SYMBOL(drm_i2c_encoder_prepare);
156+
157+
void drm_i2c_encoder_commit(struct drm_encoder *encoder)
158+
{
159+
drm_i2c_encoder_dpms(encoder, DRM_MODE_DPMS_ON);
160+
}
161+
EXPORT_SYMBOL(drm_i2c_encoder_commit);
162+
163+
void drm_i2c_encoder_mode_set(struct drm_encoder *encoder,
164+
struct drm_display_mode *mode,
165+
struct drm_display_mode *adjusted_mode)
166+
{
167+
get_slave_funcs(encoder)->mode_set(encoder, mode, adjusted_mode);
168+
}
169+
EXPORT_SYMBOL(drm_i2c_encoder_mode_set);
170+
171+
enum drm_connector_status drm_i2c_encoder_detect(struct drm_encoder *encoder,
172+
struct drm_connector *connector)
173+
{
174+
return get_slave_funcs(encoder)->detect(encoder, connector);
175+
}
176+
EXPORT_SYMBOL(drm_i2c_encoder_detect);
177+
178+
void drm_i2c_encoder_save(struct drm_encoder *encoder)
179+
{
180+
get_slave_funcs(encoder)->save(encoder);
181+
}
182+
EXPORT_SYMBOL(drm_i2c_encoder_save);
183+
184+
void drm_i2c_encoder_restore(struct drm_encoder *encoder)
185+
{
186+
get_slave_funcs(encoder)->restore(encoder);
187+
}
188+
EXPORT_SYMBOL(drm_i2c_encoder_restore);

‎drivers/gpu/drm/drm_fb_cma_helper.c‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,59 @@ struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
180180
}
181181
EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_obj);
182182

183+
#ifdef CONFIG_DEBUG_FS
184+
/**
185+
* drm_fb_cma_describe() - Helper to dump information about a single
186+
* CMA framebuffer object
187+
*/
188+
void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m)
189+
{
190+
struct drm_fb_cma *fb_cma = to_fb_cma(fb);
191+
int i, n = drm_format_num_planes(fb->pixel_format);
192+
193+
seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height,
194+
(char *)&fb->pixel_format);
195+
196+
for (i = 0; i < n; i++) {
197+
seq_printf(m, " %d: offset=%d pitch=%d, obj: ",
198+
i, fb->offsets[i], fb->pitches[i]);
199+
drm_gem_cma_describe(fb_cma->obj[i], m);
200+
}
201+
}
202+
EXPORT_SYMBOL_GPL(drm_fb_cma_describe);
203+
204+
/**
205+
* drm_fb_cma_debugfs_show() - Helper to list CMA framebuffer objects
206+
* in debugfs.
207+
*/
208+
int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg)
209+
{
210+
struct drm_info_node *node = (struct drm_info_node *) m->private;
211+
struct drm_device *dev = node->minor->dev;
212+
struct drm_framebuffer *fb;
213+
int ret;
214+
215+
ret = mutex_lock_interruptible(&dev->mode_config.mutex);
216+
if (ret)
217+
return ret;
218+
219+
ret = mutex_lock_interruptible(&dev->struct_mutex);
220+
if (ret) {
221+
mutex_unlock(&dev->mode_config.mutex);
222+
return ret;
223+
}
224+
225+
list_for_each_entry(fb, &dev->mode_config.fb_list, head)
226+
drm_fb_cma_describe(fb, m);
227+
228+
mutex_unlock(&dev->struct_mutex);
229+
mutex_unlock(&dev->mode_config.mutex);
230+
231+
return 0;
232+
}
233+
EXPORT_SYMBOL_GPL(drm_fb_cma_debugfs_show);
234+
#endif
235+
183236
static struct fb_ops drm_fbdev_cma_ops = {
184237
.owner = THIS_MODULE,
185238
.fb_fillrect = sys_fillrect,

‎drivers/gpu/drm/drm_gem_cma_helper.c‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,24 @@ int drm_gem_cma_dumb_destroy(struct drm_file *file_priv,
249249
return drm_gem_handle_delete(file_priv, handle);
250250
}
251251
EXPORT_SYMBOL_GPL(drm_gem_cma_dumb_destroy);
252+
253+
#ifdef CONFIG_DEBUG_FS
254+
void drm_gem_cma_describe(struct drm_gem_cma_object *cma_obj, struct seq_file *m)
255+
{
256+
struct drm_gem_object *obj = &cma_obj->base;
257+
struct drm_device *dev = obj->dev;
258+
uint64_t off = 0;
259+
260+
WARN_ON(!mutex_is_locked(&dev->struct_mutex));
261+
262+
if (obj->map_list.map)
263+
off = (uint64_t)obj->map_list.hash.key;
264+
265+
seq_printf(m, "%2d (%2d) %08llx %08Zx %p %d",
266+
obj->name, obj->refcount.refcount.counter,
267+
off, cma_obj->paddr, cma_obj->vaddr, obj->size);
268+
269+
seq_printf(m, "\n");
270+
}
271+
EXPORT_SYMBOL_GPL(drm_gem_cma_describe);
272+
#endif

‎drivers/gpu/drm/drm_irq.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ void drm_send_vblank_event(struct drm_device *dev, int crtc,
867867

868868
now = get_drm_timestamp();
869869
}
870+
e->pipe = crtc;
870871
send_vblank_event(dev, e, seq, &now);
871872
}
872873
EXPORT_SYMBOL(drm_send_vblank_event);

0 commit comments

Comments
 (0)