Skip to content

Commit 848819c

Browse files
committed
Merge tag 'imx-drm-fixes-2016-02-19' of git://git.pengutronix.de/git/pza/linux into drm-fixes
ipu-v3 probe and imx-drm crtc and plane fixes - Fix ipu probe if optional port nodes are not present in the device tree - Reset the ipu before initializing interrupts, not thereafter - Notify DRM core about the state of vblank interrupts - Add missing RGB565 format to the list of plate formats * tag 'imx-drm-fixes-2016-02-19' of git://git.pengutronix.de/git/pza/linux: drm/imx: Add missing DRM_FORMAT_RGB565 to ipu_plane_formats drm/imx: notify DRM core about CRTC vblank state gpu: ipu-v3: Reset IPU before activating IRQ gpu: ipu-v3: Do not bail out on missing optional port nodes
2 parents 9138301 + 33bee52 commit 848819c

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

drivers/gpu/drm/imx/ipuv3-crtc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static void ipu_fb_enable(struct ipu_crtc *ipu_crtc)
6464
/* Start DC channel and DI after IDMAC */
6565
ipu_dc_enable_channel(ipu_crtc->dc);
6666
ipu_di_enable(ipu_crtc->di);
67+
drm_crtc_vblank_on(&ipu_crtc->base);
6768

6869
ipu_crtc->enabled = 1;
6970
}
@@ -80,6 +81,7 @@ static void ipu_fb_disable(struct ipu_crtc *ipu_crtc)
8081
ipu_di_disable(ipu_crtc->di);
8182
ipu_plane_disable(ipu_crtc->plane[0]);
8283
ipu_dc_disable(ipu);
84+
drm_crtc_vblank_off(&ipu_crtc->base);
8385

8486
ipu_crtc->enabled = 0;
8587
}

drivers/gpu/drm/imx/ipuv3-plane.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ static const uint32_t ipu_plane_formats[] = {
4242
DRM_FORMAT_YVYU,
4343
DRM_FORMAT_YUV420,
4444
DRM_FORMAT_YVU420,
45+
DRM_FORMAT_RGB565,
4546
};
4647

4748
int ipu_plane_irq(struct ipu_plane *ipu_plane)

drivers/gpu/ipu-v3/ipu-common.c

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,24 +1050,27 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
10501050
for (i = 0; i < ARRAY_SIZE(client_reg); i++) {
10511051
const struct ipu_platform_reg *reg = &client_reg[i];
10521052
struct platform_device *pdev;
1053+
struct device_node *of_node;
1054+
1055+
/* Associate subdevice with the corresponding port node */
1056+
of_node = of_graph_get_port_by_id(dev->of_node, i);
1057+
if (!of_node) {
1058+
dev_info(dev,
1059+
"no port@%d node in %s, not using %s%d\n",
1060+
i, dev->of_node->full_name,
1061+
(i / 2) ? "DI" : "CSI", i % 2);
1062+
continue;
1063+
}
10531064

10541065
pdev = platform_device_alloc(reg->name, id++);
10551066
if (!pdev) {
10561067
ret = -ENOMEM;
10571068
goto err_register;
10581069
}
10591070

1071+
pdev->dev.of_node = of_node;
10601072
pdev->dev.parent = dev;
10611073

1062-
/* Associate subdevice with the corresponding port node */
1063-
pdev->dev.of_node = of_graph_get_port_by_id(dev->of_node, i);
1064-
if (!pdev->dev.of_node) {
1065-
dev_err(dev, "missing port@%d node in %s\n", i,
1066-
dev->of_node->full_name);
1067-
ret = -ENODEV;
1068-
goto err_register;
1069-
}
1070-
10711074
ret = platform_device_add_data(pdev, &reg->pdata,
10721075
sizeof(reg->pdata));
10731076
if (!ret)
@@ -1289,10 +1292,6 @@ static int ipu_probe(struct platform_device *pdev)
12891292
ipu->irq_sync = irq_sync;
12901293
ipu->irq_err = irq_err;
12911294

1292-
ret = ipu_irq_init(ipu);
1293-
if (ret)
1294-
goto out_failed_irq;
1295-
12961295
ret = device_reset(&pdev->dev);
12971296
if (ret) {
12981297
dev_err(&pdev->dev, "failed to reset: %d\n", ret);
@@ -1302,6 +1301,10 @@ static int ipu_probe(struct platform_device *pdev)
13021301
if (ret)
13031302
goto out_failed_reset;
13041303

1304+
ret = ipu_irq_init(ipu);
1305+
if (ret)
1306+
goto out_failed_irq;
1307+
13051308
/* Set MCU_T to divide MCU access window into 2 */
13061309
ipu_cm_write(ipu, 0x00400000L | (IPU_MCU_T_DEFAULT << 18),
13071310
IPU_DISP_GEN);
@@ -1324,9 +1327,9 @@ static int ipu_probe(struct platform_device *pdev)
13241327
failed_add_clients:
13251328
ipu_submodules_exit(ipu);
13261329
failed_submodules_init:
1327-
out_failed_reset:
13281330
ipu_irq_exit(ipu);
13291331
out_failed_irq:
1332+
out_failed_reset:
13301333
clk_disable_unprepare(ipu->clk);
13311334
return ret;
13321335
}

0 commit comments

Comments
 (0)