]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
drm: xlnx: mixer: Use xlnx pipeline call
authorHyun Kwon <hyun.kwon@xilinx.com>
Tue, 13 Feb 2018 17:33:47 +0000 (09:33 -0800)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 1 Mar 2018 08:20:19 +0000 (09:20 +0100)
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>
drivers/gpu/drm/xlnx/xlnx_mixer.c

index 5fa32916a06f4d0ef1b5ec733f8bad354fa973c1..216a329322fe8553af82a604437ab5c39f02fdb1 100644 (file)
@@ -266,6 +266,7 @@ struct xlnx_mix_hw {
 /**
  * struct xlnx_mix - Container for interfacing DRM driver to mixer
  * @mixer_hw: Object representing actual hardware state of mixer
+ * @master: Logical master device from xlnx drm
  * @crtc: Xilinx DRM driver crtc object
  * @drm_primary_layer: Hardware layer serving as logical DRM primary layer
  * @hw_master_layer: Base video streaming layer
@@ -293,6 +294,7 @@ struct xlnx_mix_hw {
  */
 struct xlnx_mix {
        struct xlnx_mix_hw mixer_hw;
+       struct platform_device *master;
        struct xlnx_crtc crtc;
        struct xlnx_mix_plane *drm_primary_layer;
        struct xlnx_mix_plane *hw_master_layer;
@@ -2559,13 +2561,28 @@ static int xlnx_mix_probe(struct platform_device *pdev)
 
        ret = component_add(&pdev->dev, &xlnx_mix_component_ops);
        if (ret)
-               return ret;
+               goto err;
+
+       mixer->master = xlnx_drm_pipeline_init(pdev);
+       if (IS_ERR(mixer->master)) {
+               dev_err(&pdev->dev, "Failed to initialize the drm pipeline\n");
+               goto err_component;
+       }
+
        dev_info(&pdev->dev, "Xilinx Mixer driver probed success\n");
        return ret;
+
+err_component:
+       component_del(&pdev->dev, &xlnx_mix_component_ops);
+err:
+       return ret;
 }
 
 static int xlnx_mix_remove(struct platform_device *pdev)
 {
+       struct xlnx_mix *mixer = platform_get_drvdata(pdev);
+
+       xlnx_drm_pipeline_exit(mixer->master);
        component_del(&pdev->dev, &xlnx_mix_component_ops);
        return 0;
 }