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

[media] v4l: vsp1: Use pipeline display list to decide how to write to modules

This allows getting rid of the vsp1_device::use_dl field.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 94d48e56
...@@ -85,8 +85,6 @@ struct vsp1_device { ...@@ -85,8 +85,6 @@ struct vsp1_device {
struct media_entity_operations media_ops; struct media_entity_operations media_ops;
struct vsp1_drm *drm; struct vsp1_drm *drm;
bool use_dl;
}; };
int vsp1_device_get(struct vsp1_device *vsp1); int vsp1_device_get(struct vsp1_device *vsp1);
...@@ -104,14 +102,4 @@ static inline void vsp1_write(struct vsp1_device *vsp1, u32 reg, u32 data) ...@@ -104,14 +102,4 @@ static inline void vsp1_write(struct vsp1_device *vsp1, u32 reg, u32 data)
iowrite32(data, vsp1->mmio + reg); iowrite32(data, vsp1->mmio + reg);
} }
#include "vsp1_dl.h"
static inline void vsp1_mod_write(struct vsp1_entity *e, u32 reg, u32 data)
{
if (e->vsp1->use_dl)
vsp1_dl_add(e, reg, data);
else
vsp1_write(e->vsp1, reg, data);
}
#endif /* __VSP1_H__ */ #endif /* __VSP1_H__ */
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "vsp1.h" #include "vsp1.h"
#include "vsp1_dl.h" #include "vsp1_dl.h"
#include "vsp1_pipe.h"
/* /*
* Global resources * Global resources
...@@ -129,10 +128,8 @@ void vsp1_dl_begin(struct vsp1_dl *dl) ...@@ -129,10 +128,8 @@ void vsp1_dl_begin(struct vsp1_dl *dl)
list->reg_count = 0; list->reg_count = 0;
} }
void vsp1_dl_add(struct vsp1_entity *e, u32 reg, u32 data) void vsp1_dl_add(struct vsp1_dl *dl, u32 reg, u32 data)
{ {
struct vsp1_pipeline *pipe = to_vsp1_pipeline(&e->subdev.entity);
struct vsp1_dl *dl = pipe->dl;
struct vsp1_dl_list *list = dl->lists.write; struct vsp1_dl_list *list = dl->lists.write;
list->body[list->reg_count].addr = reg; list->body[list->reg_count].addr = reg;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#ifndef __VSP1_DL_H__ #ifndef __VSP1_DL_H__
#define __VSP1_DL_H__ #define __VSP1_DL_H__
#include "vsp1_entity.h" #include <linux/types.h>
struct vsp1_device; struct vsp1_device;
struct vsp1_dl; struct vsp1_dl;
...@@ -25,18 +25,10 @@ void vsp1_dl_setup(struct vsp1_device *vsp1); ...@@ -25,18 +25,10 @@ void vsp1_dl_setup(struct vsp1_device *vsp1);
void vsp1_dl_reset(struct vsp1_dl *dl); void vsp1_dl_reset(struct vsp1_dl *dl);
void vsp1_dl_begin(struct vsp1_dl *dl); void vsp1_dl_begin(struct vsp1_dl *dl);
void vsp1_dl_add(struct vsp1_entity *e, u32 reg, u32 data); void vsp1_dl_add(struct vsp1_dl *dl, u32 reg, u32 data);
void vsp1_dl_commit(struct vsp1_dl *dl); void vsp1_dl_commit(struct vsp1_dl *dl);
void vsp1_dl_irq_display_start(struct vsp1_dl *dl); void vsp1_dl_irq_display_start(struct vsp1_dl *dl);
void vsp1_dl_irq_frame_end(struct vsp1_dl *dl); void vsp1_dl_irq_frame_end(struct vsp1_dl *dl);
static inline void vsp1_dl_mod_write(struct vsp1_entity *e, u32 reg, u32 data)
{
if (e->vsp1->use_dl)
vsp1_dl_add(e, reg, data);
else
vsp1_write(e->vsp1, reg, data);
}
#endif /* __VSP1_DL_H__ */ #endif /* __VSP1_DL_H__ */
...@@ -387,13 +387,10 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) ...@@ -387,13 +387,10 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
/* Register subdev nodes if the userspace API is enabled or initialize /* Register subdev nodes if the userspace API is enabled or initialize
* the DRM pipeline otherwise. * the DRM pipeline otherwise.
*/ */
if (vsp1->info->uapi) { if (vsp1->info->uapi)
vsp1->use_dl = false;
ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev); ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev);
} else { else
vsp1->use_dl = true;
ret = vsp1_drm_init(vsp1); ret = vsp1_drm_init(vsp1);
}
if (ret < 0) if (ret < 0)
goto done; goto done;
...@@ -465,7 +462,7 @@ static int vsp1_device_init(struct vsp1_device *vsp1) ...@@ -465,7 +462,7 @@ static int vsp1_device_init(struct vsp1_device *vsp1)
vsp1_write(vsp1, VI6_DPR_HGT_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) | vsp1_write(vsp1, VI6_DPR_HGT_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) |
(VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT)); (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
if (vsp1->use_dl) if (!vsp1->info->uapi)
vsp1_dl_setup(vsp1); vsp1_dl_setup(vsp1);
return 0; return 0;
......
...@@ -19,7 +19,19 @@ ...@@ -19,7 +19,19 @@
#include <media/v4l2-subdev.h> #include <media/v4l2-subdev.h>
#include "vsp1.h" #include "vsp1.h"
#include "vsp1_dl.h"
#include "vsp1_entity.h" #include "vsp1_entity.h"
#include "vsp1_pipe.h"
void vsp1_mod_write(struct vsp1_entity *e, u32 reg, u32 data)
{
struct vsp1_pipeline *pipe = to_vsp1_pipeline(&e->subdev.entity);
if (pipe->dl)
vsp1_dl_add(pipe->dl, reg, data);
else
vsp1_write(e->vsp1, reg, data);
}
bool vsp1_entity_is_streaming(struct vsp1_entity *entity) bool vsp1_entity_is_streaming(struct vsp1_entity *entity)
{ {
......
...@@ -103,4 +103,6 @@ int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming); ...@@ -103,4 +103,6 @@ int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming);
void vsp1_entity_route_setup(struct vsp1_entity *source); void vsp1_entity_route_setup(struct vsp1_entity *source);
void vsp1_mod_write(struct vsp1_entity *e, u32 reg, u32 data);
#endif /* __VSP1_ENTITY_H__ */ #endif /* __VSP1_ENTITY_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