Commit f3af9572 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] v4l: vsp1: Add VSP+DU support

Implement internal control of the VSP pipeline to be used by the DU
DRM/KMS driver when using the VSP as an internal composer handled
through DRM/KMS only.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent babca007
vsp1-y := vsp1_drv.o vsp1_entity.o vsp1_pipe.o vsp1-y := vsp1_drv.o vsp1_entity.o vsp1_pipe.o
vsp1-y += vsp1_video.o vsp1-y += vsp1_drm.o vsp1_video.o
vsp1-y += vsp1_rpf.o vsp1_rwpf.o vsp1_wpf.o vsp1-y += vsp1_rpf.o vsp1_rwpf.o vsp1_wpf.o
vsp1-y += vsp1_hsit.o vsp1_lif.o vsp1_lut.o vsp1-y += vsp1_hsit.o vsp1_lif.o vsp1_lut.o
vsp1-y += vsp1_bru.o vsp1_sru.o vsp1_uds.o vsp1-y += vsp1_bru.o vsp1_sru.o vsp1_uds.o
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
struct clk; struct clk;
struct device; struct device;
struct vsp1_drm;
struct vsp1_platform_data; struct vsp1_platform_data;
struct vsp1_bru; struct vsp1_bru;
struct vsp1_hsit; struct vsp1_hsit;
...@@ -78,8 +79,8 @@ struct vsp1_device { ...@@ -78,8 +79,8 @@ struct vsp1_device {
struct v4l2_device v4l2_dev; struct v4l2_device v4l2_dev;
struct media_device media_dev; struct media_device media_dev;
struct media_entity_operations media_ops; struct media_entity_operations media_ops;
struct vsp1_drm *drm;
}; };
int vsp1_device_get(struct vsp1_device *vsp1); int vsp1_device_get(struct vsp1_device *vsp1);
......
This diff is collapsed.
/*
* vsp1_drm.h -- R-Car VSP1 DRM/KMS Interface
*
* Copyright (C) 2015 Renesas Electronics Corporation
*
* Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef __VSP1_DRM_H__
#define __VSP1_DRM_H__
#include "vsp1_pipe.h"
struct vsp1_drm {
struct vsp1_pipeline pipe;
bool update;
};
int vsp1_drm_init(struct vsp1_device *vsp1);
int vsp1_drm_create_links(struct vsp1_device *vsp1);
#endif /* __VSP1_DRM_H__ */
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "vsp1.h" #include "vsp1.h"
#include "vsp1_bru.h" #include "vsp1_bru.h"
#include "vsp1_drm.h"
#include "vsp1_hsit.h" #include "vsp1_hsit.h"
#include "vsp1_lif.h" #include "vsp1_lif.h"
#include "vsp1_lut.h" #include "vsp1_lut.h"
...@@ -120,7 +121,7 @@ static int vsp1_create_sink_links(struct vsp1_device *vsp1, ...@@ -120,7 +121,7 @@ static int vsp1_create_sink_links(struct vsp1_device *vsp1,
return 0; return 0;
} }
static int vsp1_create_links(struct vsp1_device *vsp1) static int vsp1_uapi_create_links(struct vsp1_device *vsp1)
{ {
struct vsp1_entity *entity; struct vsp1_entity *entity;
unsigned int i; unsigned int i;
...@@ -145,9 +146,6 @@ static int vsp1_create_links(struct vsp1_device *vsp1) ...@@ -145,9 +146,6 @@ static int vsp1_create_links(struct vsp1_device *vsp1)
return ret; return ret;
} }
if (!vsp1->pdata.uapi)
return 0;
for (i = 0; i < vsp1->pdata.rpf_count; ++i) { for (i = 0; i < vsp1->pdata.rpf_count; ++i) {
struct vsp1_rwpf *rpf = vsp1->rpf[i]; struct vsp1_rwpf *rpf = vsp1->rpf[i];
...@@ -360,15 +358,22 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) ...@@ -360,15 +358,22 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
} }
/* Create links. */ /* Create links. */
ret = vsp1_create_links(vsp1); if (vsp1->pdata.uapi)
ret = vsp1_uapi_create_links(vsp1);
else
ret = vsp1_drm_create_links(vsp1);
if (ret < 0) if (ret < 0)
goto done; goto done;
if (vsp1->pdata.uapi) { /* Register subdev nodes if the userspace API is enabled or initialize
* the DRM pipeline otherwise.
*/
if (vsp1->pdata.uapi)
ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev); ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev);
if (ret < 0) else
goto done; ret = vsp1_drm_init(vsp1);
} if (ret < 0)
goto done;
ret = media_device_register(mdev); ret = media_device_register(mdev);
......
/*
* vsp1.h -- R-Car VSP1 API
*
* Copyright (C) 2015 Renesas Electronics Corporation
*
* Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef __MEDIA_VSP1_H__
#define __MEDIA_VSP1_H__
#include <linux/types.h>
struct device;
struct v4l2_rect;
int vsp1_du_init(struct device *dev);
int vsp1_du_setup_lif(struct device *dev, unsigned int width,
unsigned int height);
int vsp1_du_setup_rpf(struct device *dev, unsigned int rpf, u32 pixelformat,
unsigned int pitch, dma_addr_t mem[2],
const struct v4l2_rect *src, const struct v4l2_rect *dst);
#endif /* __MEDIA_VSP1_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment