Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b78f036 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

media: v4l: vsp1: Print the correct blending unit name in debug messages



The DRM pipelines can use either the BRU or the BRS for blending. Make
sure the right name is used in debugging messages to avoid confusion.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: default avatarKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 613928e8
Loading
Loading
Loading
Loading
+8 −13
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@
#include "vsp1_pipe.h"
#include "vsp1_pipe.h"
#include "vsp1_rwpf.h"
#include "vsp1_rwpf.h"


#define BRU_NAME(e)	(e)->type == VSP1_ENTITY_BRU ? "BRU" : "BRS"


/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
 * Interrupt Handling
 * Interrupt Handling
@@ -88,7 +89,6 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index,
	struct vsp1_entity *next;
	struct vsp1_entity *next;
	struct vsp1_dl_list *dl;
	struct vsp1_dl_list *dl;
	struct v4l2_subdev_format format;
	struct v4l2_subdev_format format;
	const char *bru_name;
	unsigned long flags;
	unsigned long flags;
	unsigned int i;
	unsigned int i;
	int ret;
	int ret;
@@ -99,7 +99,6 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index,
	drm_pipe = &vsp1->drm->pipe[pipe_index];
	drm_pipe = &vsp1->drm->pipe[pipe_index];
	pipe = &drm_pipe->pipe;
	pipe = &drm_pipe->pipe;
	bru = to_bru(&pipe->bru->subdev);
	bru = to_bru(&pipe->bru->subdev);
	bru_name = pipe->bru->type == VSP1_ENTITY_BRU ? "BRU" : "BRS";


	if (!cfg) {
	if (!cfg) {
		/*
		/*
@@ -165,7 +164,7 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index,


		dev_dbg(vsp1->dev, "%s: set format %ux%u (%x) on %s pad %u\n",
		dev_dbg(vsp1->dev, "%s: set format %ux%u (%x) on %s pad %u\n",
			__func__, format.format.width, format.format.height,
			__func__, format.format.width, format.format.height,
			format.format.code, bru_name, i);
			format.format.code, BRU_NAME(pipe->bru), i);
	}
	}


	format.pad = pipe->bru->source_pad;
	format.pad = pipe->bru->source_pad;
@@ -181,7 +180,7 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index,


	dev_dbg(vsp1->dev, "%s: set format %ux%u (%x) on %s pad %u\n",
	dev_dbg(vsp1->dev, "%s: set format %ux%u (%x) on %s pad %u\n",
		__func__, format.format.width, format.format.height,
		__func__, format.format.width, format.format.height,
		format.format.code, bru_name, i);
		format.format.code, BRU_NAME(pipe->bru), i);


	format.pad = RWPF_PAD_SINK;
	format.pad = RWPF_PAD_SINK;
	ret = v4l2_subdev_call(&pipe->output->entity.subdev, pad, set_fmt, NULL,
	ret = v4l2_subdev_call(&pipe->output->entity.subdev, pad, set_fmt, NULL,
@@ -473,9 +472,9 @@ static int vsp1_du_setup_rpf_pipe(struct vsp1_device *vsp1,
	if (ret < 0)
	if (ret < 0)
		return ret;
		return ret;


	dev_dbg(vsp1->dev, "%s: set format %ux%u (%x) on BRU pad %u\n",
	dev_dbg(vsp1->dev, "%s: set format %ux%u (%x) on %s pad %u\n",
		__func__, format.format.width, format.format.height,
		__func__, format.format.width, format.format.height,
		format.format.code, format.pad);
		format.format.code, BRU_NAME(pipe->bru), format.pad);


	sel.pad = bru_input;
	sel.pad = bru_input;
	sel.target = V4L2_SEL_TGT_COMPOSE;
	sel.target = V4L2_SEL_TGT_COMPOSE;
@@ -486,10 +485,9 @@ static int vsp1_du_setup_rpf_pipe(struct vsp1_device *vsp1,
	if (ret < 0)
	if (ret < 0)
		return ret;
		return ret;


	dev_dbg(vsp1->dev,
	dev_dbg(vsp1->dev, "%s: set selection (%u,%u)/%ux%u on %s pad %u\n",
		"%s: set selection (%u,%u)/%ux%u on BRU pad %u\n",
		__func__, sel.r.left, sel.r.top, sel.r.width, sel.r.height,
		__func__, sel.r.left, sel.r.top, sel.r.width, sel.r.height,
		sel.pad);
		BRU_NAME(pipe->bru), sel.pad);


	return 0;
	return 0;
}
}
@@ -514,12 +512,9 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index)
	struct vsp1_entity *entity;
	struct vsp1_entity *entity;
	struct vsp1_entity *next;
	struct vsp1_entity *next;
	struct vsp1_dl_list *dl;
	struct vsp1_dl_list *dl;
	const char *bru_name;
	unsigned int i;
	unsigned int i;
	int ret;
	int ret;


	bru_name = pipe->bru->type == VSP1_ENTITY_BRU ? "BRU" : "BRS";

	/* Prepare the display list. */
	/* Prepare the display list. */
	dl = vsp1_dl_list_get(pipe->output->dlm);
	dl = vsp1_dl_list_get(pipe->output->dlm);


@@ -570,7 +565,7 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index)
		rpf->entity.sink_pad = i;
		rpf->entity.sink_pad = i;


		dev_dbg(vsp1->dev, "%s: connecting RPF.%u to %s:%u\n",
		dev_dbg(vsp1->dev, "%s: connecting RPF.%u to %s:%u\n",
			__func__, rpf->entity.index, bru_name, i);
			__func__, rpf->entity.index, BRU_NAME(pipe->bru), i);


		ret = vsp1_du_setup_rpf_pipe(vsp1, pipe, rpf, i);
		ret = vsp1_du_setup_rpf_pipe(vsp1, pipe, rpf, i);
		if (ret < 0)
		if (ret < 0)