Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: renesas: vsp1: Name nested structure in vsp1_drm

The vsp1_drm structure defines an anonymous nested structure to store
per-input data. In preparation for extending that structure, give it a
name and is it through the driver. This improves code readability.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250429232904.26413-8-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

authored by

Laurent Pinchart and committed by
Hans Verkuil
67cbb2be e6c9597e

+10 -10
+9 -9
drivers/media/platform/renesas/vsp1/vsp1_drm.c
··· 118 118 struct vsp1_entity *uif, 119 119 unsigned int brx_input) 120 120 { 121 + const struct vsp1_drm_input *input = &vsp1->drm->inputs[rpf->entity.index]; 121 122 struct v4l2_subdev_selection sel = { 122 123 .which = V4L2_SUBDEV_FORMAT_ACTIVE, 123 124 }; 124 125 struct v4l2_subdev_format format = { 125 126 .which = V4L2_SUBDEV_FORMAT_ACTIVE, 126 127 }; 127 - const struct v4l2_rect *crop; 128 128 int ret; 129 129 130 130 /* 131 131 * Configure the format on the RPF sink pad and propagate it up to the 132 132 * BRx sink pad. 133 133 */ 134 - crop = &vsp1->drm->inputs[rpf->entity.index].crop; 135 - 136 134 format.pad = RWPF_PAD_SINK; 137 - format.format.width = crop->width + crop->left; 138 - format.format.height = crop->height + crop->top; 135 + format.format.width = input->crop.width + input->crop.left; 136 + format.format.height = input->crop.height + input->crop.top; 139 137 format.format.code = rpf->fmtinfo->mbus; 140 138 format.format.field = V4L2_FIELD_NONE; 141 139 ··· 149 151 150 152 sel.pad = RWPF_PAD_SINK; 151 153 sel.target = V4L2_SEL_TGT_CROP; 152 - sel.r = *crop; 154 + sel.r = input->crop; 153 155 154 156 ret = v4l2_subdev_call(&rpf->entity.subdev, pad, set_selection, NULL, 155 157 &sel); ··· 824 826 { 825 827 struct vsp1_device *vsp1 = dev_get_drvdata(dev); 826 828 struct vsp1_drm_pipeline *drm_pipe = &vsp1->drm->pipe[pipe_index]; 829 + struct vsp1_drm_input *input; 827 830 struct vsp1_rwpf *rpf; 828 831 int ret; 829 832 830 833 if (rpf_index >= vsp1->info->rpf_count) 831 834 return -EINVAL; 832 835 836 + input = &vsp1->drm->inputs[rpf_index]; 833 837 rpf = vsp1->rpf[rpf_index]; 834 838 835 839 if (!cfg) { ··· 873 873 874 874 rpf->format.flags = cfg->premult ? V4L2_PIX_FMT_FLAG_PREMUL_ALPHA : 0; 875 875 876 - vsp1->drm->inputs[rpf_index].crop = cfg->src; 877 - vsp1->drm->inputs[rpf_index].compose = cfg->dst; 878 - vsp1->drm->inputs[rpf_index].zpos = cfg->zpos; 876 + input->crop = cfg->src; 877 + input->compose = cfg->dst; 878 + input->zpos = cfg->zpos; 879 879 880 880 drm_pipe->pipe.inputs[rpf_index] = rpf; 881 881
+1 -1
drivers/media/platform/renesas/vsp1/vsp1_drm.h
··· 59 59 struct vsp1_drm_pipeline pipe[VSP1_MAX_LIF]; 60 60 struct mutex lock; 61 61 62 - struct { 62 + struct vsp1_drm_input { 63 63 struct v4l2_rect crop; 64 64 struct v4l2_rect compose; 65 65 unsigned int zpos;