Skip to content

Commit

Permalink
drm: xlnx: pl_disp: Use xlnx pipeline calls
Browse files Browse the repository at this point in the history
Use xlnx_drm_pipeline_init() call as the dt binding is removed
for xlnx drm. The xlnx drm is more or less a library, and
should be explicitly initialized / released.

Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
Tested-by: Saurabh Sengar <saurabhs@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
  • Loading branch information
xlnx-hyunkwon authored and Michal Simek committed Mar 1, 2018
1 parent f5ea6df commit 3f09279
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/gpu/drm/xlnx/xlnx_pl_disp.c
Expand Up @@ -23,6 +23,7 @@
#include <linux/of.h>
#include <linux/of_dma.h>
#include <linux/platform_device.h>
#include "xlnx_drv.h"
#include "xlnx_crtc.h"

/*
Expand Down Expand Up @@ -56,6 +57,7 @@ struct xlnx_dma_chan {
/**
* struct xlnx_pl_disp - struct for display subsystem
* @dev: device structure
* @master: logical master device from xlnx drm
* @xlnx_crtc: Xilinx DRM driver crtc object
* @plane: base drm plane object
* @chan: struct for DMA engine
Expand All @@ -67,6 +69,7 @@ struct xlnx_dma_chan {
*/
struct xlnx_pl_disp {
struct device *dev;
struct platform_device *master;
struct xlnx_crtc xlnx_crtc;
struct drm_plane plane;
struct xlnx_dma_chan *chan[XLNX_DMA_MAX_CHAN];
Expand Down Expand Up @@ -477,10 +480,19 @@ static int xlnx_pl_disp_probe(struct platform_device *pdev)
if (ret)
goto err_dma;

xlnx_pl_disp->master = xlnx_drm_pipeline_init(pdev);
if (IS_ERR(xlnx_pl_disp->master)) {
ret = PTR_ERR(xlnx_pl_disp->dev);
dev_err(dev, "failed to initialize the drm pipeline\n");
goto err_component;
}

dev_info(&pdev->dev, "Xlnx PL display driver probed\n");

return 0;

err_component:
component_del(dev, &xlnx_pl_disp_component_ops);
err_dma:
for (i = 0; i < XLNX_DMA_MAX_CHAN; i++) {
if (xlnx_pl_disp->chan[i])
Expand All @@ -495,6 +507,7 @@ static int xlnx_pl_disp_remove(struct platform_device *pdev)
struct xlnx_pl_disp *xlnx_pl_disp = platform_get_drvdata(pdev);
unsigned int i;

xlnx_drm_pipeline_exit(xlnx_pl_disp->master);
component_del(&pdev->dev, &xlnx_pl_disp_component_ops);
for (i = 0; i < XLNX_DMA_MAX_CHAN; i++) {
struct xlnx_dma_chan *xlnx_dma_chan = xlnx_pl_disp->chan[i];
Expand Down

0 comments on commit 3f09279

Please sign in to comment.