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

media: renesas: vsp1: Fix references to pad config

V4L2 subdev operations have moved from operating on a
v4l2_subdev_pad_config to a v4l2_subdev_state a long time ago. Fix
remaining incorrect references to pad config in function and variable
names.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Laurent Pinchart and committed by
Hans Verkuil
30d187cd 073249b8

+162 -179
+19 -21
drivers/media/platform/renesas/vsp1/vsp1_brx.c
··· 136 136 struct v4l2_subdev_format *fmt) 137 137 { 138 138 struct vsp1_brx *brx = to_brx(subdev); 139 - struct v4l2_subdev_state *config; 139 + struct v4l2_subdev_state *state; 140 140 struct v4l2_mbus_framefmt *format; 141 141 int ret = 0; 142 142 143 143 mutex_lock(&brx->entity.lock); 144 144 145 - config = vsp1_entity_get_pad_config(&brx->entity, sd_state, 146 - fmt->which); 147 - if (!config) { 145 + state = vsp1_entity_get_state(&brx->entity, sd_state, fmt->which); 146 + if (!state) { 148 147 ret = -EINVAL; 149 148 goto done; 150 149 } 151 150 152 - brx_try_format(brx, config, fmt->pad, &fmt->format); 151 + brx_try_format(brx, state, fmt->pad, &fmt->format); 153 152 154 - format = vsp1_entity_get_pad_format(&brx->entity, config, fmt->pad); 153 + format = vsp1_entity_get_pad_format(&brx->entity, state, fmt->pad); 155 154 *format = fmt->format; 156 155 157 156 /* Reset the compose rectangle. */ 158 157 if (fmt->pad != brx->entity.source_pad) { 159 158 struct v4l2_rect *compose; 160 159 161 - compose = brx_get_compose(brx, config, fmt->pad); 160 + compose = brx_get_compose(brx, state, fmt->pad); 162 161 compose->left = 0; 163 162 compose->top = 0; 164 163 compose->width = format->width; ··· 170 171 171 172 for (i = 0; i <= brx->entity.source_pad; ++i) { 172 173 format = vsp1_entity_get_pad_format(&brx->entity, 173 - config, i); 174 + state, i); 174 175 format->code = fmt->format.code; 175 176 } 176 177 } ··· 185 186 struct v4l2_subdev_selection *sel) 186 187 { 187 188 struct vsp1_brx *brx = to_brx(subdev); 188 - struct v4l2_subdev_state *config; 189 + struct v4l2_subdev_state *state; 189 190 190 191 if (sel->pad == brx->entity.source_pad) 191 192 return -EINVAL; ··· 199 200 return 0; 200 201 201 202 case V4L2_SEL_TGT_COMPOSE: 202 - config = vsp1_entity_get_pad_config(&brx->entity, sd_state, 203 - sel->which); 204 - if (!config) 203 + state = vsp1_entity_get_state(&brx->entity, sd_state, 204 + sel->which); 205 + if (!state) 205 206 return -EINVAL; 206 207 207 208 mutex_lock(&brx->entity.lock); 208 - sel->r = *brx_get_compose(brx, config, sel->pad); 209 + sel->r = *brx_get_compose(brx, state, sel->pad); 209 210 mutex_unlock(&brx->entity.lock); 210 211 return 0; 211 212 ··· 219 220 struct v4l2_subdev_selection *sel) 220 221 { 221 222 struct vsp1_brx *brx = to_brx(subdev); 222 - struct v4l2_subdev_state *config; 223 + struct v4l2_subdev_state *state; 223 224 struct v4l2_mbus_framefmt *format; 224 225 struct v4l2_rect *compose; 225 226 int ret = 0; ··· 232 233 233 234 mutex_lock(&brx->entity.lock); 234 235 235 - config = vsp1_entity_get_pad_config(&brx->entity, sd_state, 236 - sel->which); 237 - if (!config) { 236 + state = vsp1_entity_get_state(&brx->entity, sd_state, sel->which); 237 + if (!state) { 238 238 ret = -EINVAL; 239 239 goto done; 240 240 } ··· 242 244 * The compose rectangle top left corner must be inside the output 243 245 * frame. 244 246 */ 245 - format = vsp1_entity_get_pad_format(&brx->entity, config, 247 + format = vsp1_entity_get_pad_format(&brx->entity, state, 246 248 brx->entity.source_pad); 247 249 sel->r.left = clamp_t(unsigned int, sel->r.left, 0, format->width - 1); 248 250 sel->r.top = clamp_t(unsigned int, sel->r.top, 0, format->height - 1); ··· 251 253 * Scaling isn't supported, the compose rectangle size must be identical 252 254 * to the sink format size. 253 255 */ 254 - format = vsp1_entity_get_pad_format(&brx->entity, config, sel->pad); 256 + format = vsp1_entity_get_pad_format(&brx->entity, state, sel->pad); 255 257 sel->r.width = format->width; 256 258 sel->r.height = format->height; 257 259 258 - compose = brx_get_compose(brx, config, sel->pad); 260 + compose = brx_get_compose(brx, state, sel->pad); 259 261 *compose = sel->r; 260 262 261 263 done: ··· 291 293 unsigned int flags; 292 294 unsigned int i; 293 295 294 - format = vsp1_entity_get_pad_format(&brx->entity, brx->entity.config, 296 + format = vsp1_entity_get_pad_format(&brx->entity, brx->entity.state, 295 297 brx->entity.source_pad); 296 298 297 299 /*
+1 -2
drivers/media/platform/renesas/vsp1/vsp1_clu.c
··· 182 182 * The yuv_mode can't be changed during streaming. Cache it internally 183 183 * for future runtime configuration calls. 184 184 */ 185 - format = vsp1_entity_get_pad_format(&clu->entity, 186 - clu->entity.config, 185 + format = vsp1_entity_get_pad_format(&clu->entity, clu->entity.state, 187 186 CLU_PAD_SINK); 188 187 clu->yuv_mode = format->code == MEDIA_BUS_FMT_AYUV8_1X32; 189 188 }
+42 -43
drivers/media/platform/renesas/vsp1/vsp1_entity.c
··· 101 101 */ 102 102 103 103 /** 104 - * vsp1_entity_get_pad_config - Get the pad configuration for an entity 104 + * vsp1_entity_get_state - Get the subdev state for an entity 105 105 * @entity: the entity 106 106 * @sd_state: the TRY state 107 - * @which: configuration selector (ACTIVE or TRY) 107 + * @which: state selector (ACTIVE or TRY) 108 108 * 109 109 * When called with which set to V4L2_SUBDEV_FORMAT_ACTIVE the caller must hold 110 110 * the entity lock to access the returned configuration. 111 111 * 112 - * Return the pad configuration requested by the which argument. The TRY 113 - * configuration is passed explicitly to the function through the cfg argument 114 - * and simply returned when requested. The ACTIVE configuration comes from the 115 - * entity structure. 112 + * Return the subdev state requested by the which argument. The TRY state is 113 + * passed explicitly to the function through the sd_state argument and simply 114 + * returned when requested. The ACTIVE state comes from the entity structure. 116 115 */ 117 116 struct v4l2_subdev_state * 118 - vsp1_entity_get_pad_config(struct vsp1_entity *entity, 119 - struct v4l2_subdev_state *sd_state, 120 - enum v4l2_subdev_format_whence which) 117 + vsp1_entity_get_state(struct vsp1_entity *entity, 118 + struct v4l2_subdev_state *sd_state, 119 + enum v4l2_subdev_format_whence which) 121 120 { 122 121 switch (which) { 123 122 case V4L2_SUBDEV_FORMAT_ACTIVE: 124 - return entity->config; 123 + return entity->state; 125 124 case V4L2_SUBDEV_FORMAT_TRY: 126 125 default: 127 126 return sd_state; ··· 173 174 /* 174 175 * vsp1_entity_init_cfg - Initialize formats on all pads 175 176 * @subdev: V4L2 subdevice 176 - * @cfg: V4L2 subdev pad configuration 177 + * @sd_state: V4L2 subdev state 177 178 * 178 - * Initialize all pad formats with default values in the given pad config. This 179 - * function can be used as a handler for the subdev pad::init_cfg operation. 179 + * Initialize all pad formats with default values in the given subdev state. 180 + * This function can be used as a handler for the subdev pad::init_cfg 181 + * operation. 180 182 */ 181 183 int vsp1_entity_init_cfg(struct v4l2_subdev *subdev, 182 184 struct v4l2_subdev_state *sd_state) ··· 200 200 /* 201 201 * vsp1_subdev_get_pad_format - Subdev pad get_fmt handler 202 202 * @subdev: V4L2 subdevice 203 - * @cfg: V4L2 subdev pad configuration 203 + * @sd_state: V4L2 subdev state 204 204 * @fmt: V4L2 subdev format 205 205 * 206 206 * This function implements the subdev get_fmt pad operation. It can be used as ··· 211 211 struct v4l2_subdev_format *fmt) 212 212 { 213 213 struct vsp1_entity *entity = to_vsp1_entity(subdev); 214 - struct v4l2_subdev_state *config; 214 + struct v4l2_subdev_state *state; 215 215 216 - config = vsp1_entity_get_pad_config(entity, sd_state, fmt->which); 217 - if (!config) 216 + state = vsp1_entity_get_state(entity, sd_state, fmt->which); 217 + if (!state) 218 218 return -EINVAL; 219 219 220 220 mutex_lock(&entity->lock); 221 - fmt->format = *vsp1_entity_get_pad_format(entity, config, fmt->pad); 221 + fmt->format = *vsp1_entity_get_pad_format(entity, state, fmt->pad); 222 222 mutex_unlock(&entity->lock); 223 223 224 224 return 0; ··· 227 227 /* 228 228 * vsp1_subdev_enum_mbus_code - Subdev pad enum_mbus_code handler 229 229 * @subdev: V4L2 subdevice 230 - * @cfg: V4L2 subdev pad configuration 230 + * @sd_state: V4L2 subdev state 231 231 * @code: Media bus code enumeration 232 232 * @codes: Array of supported media bus codes 233 233 * @ncodes: Number of supported media bus codes ··· 250 250 251 251 code->code = codes[code->index]; 252 252 } else { 253 - struct v4l2_subdev_state *config; 253 + struct v4l2_subdev_state *state; 254 254 struct v4l2_mbus_framefmt *format; 255 255 256 256 /* ··· 260 260 if (code->index) 261 261 return -EINVAL; 262 262 263 - config = vsp1_entity_get_pad_config(entity, sd_state, 264 - code->which); 265 - if (!config) 263 + state = vsp1_entity_get_state(entity, sd_state, code->which); 264 + if (!state) 266 265 return -EINVAL; 267 266 268 267 mutex_lock(&entity->lock); 269 - format = vsp1_entity_get_pad_format(entity, config, 0); 268 + format = vsp1_entity_get_pad_format(entity, state, 0); 270 269 code->code = format->code; 271 270 mutex_unlock(&entity->lock); 272 271 } ··· 276 277 /* 277 278 * vsp1_subdev_enum_frame_size - Subdev pad enum_frame_size handler 278 279 * @subdev: V4L2 subdevice 279 - * @cfg: V4L2 subdev pad configuration 280 + * @sd_state: V4L2 subdev state 280 281 * @fse: Frame size enumeration 281 282 * @min_width: Minimum image width 282 283 * @min_height: Minimum image height ··· 295 296 unsigned int max_width, unsigned int max_height) 296 297 { 297 298 struct vsp1_entity *entity = to_vsp1_entity(subdev); 298 - struct v4l2_subdev_state *config; 299 + struct v4l2_subdev_state *state; 299 300 struct v4l2_mbus_framefmt *format; 300 301 int ret = 0; 301 302 302 - config = vsp1_entity_get_pad_config(entity, sd_state, fse->which); 303 - if (!config) 303 + state = vsp1_entity_get_state(entity, sd_state, fse->which); 304 + if (!state) 304 305 return -EINVAL; 305 306 306 - format = vsp1_entity_get_pad_format(entity, config, fse->pad); 307 + format = vsp1_entity_get_pad_format(entity, state, fse->pad); 307 308 308 309 mutex_lock(&entity->lock); 309 310 ··· 336 337 /* 337 338 * vsp1_subdev_set_pad_format - Subdev pad set_fmt handler 338 339 * @subdev: V4L2 subdevice 339 - * @cfg: V4L2 subdev pad configuration 340 + * @sd_state: V4L2 subdev state 340 341 * @fmt: V4L2 subdev format 341 342 * @codes: Array of supported media bus codes 342 343 * @ncodes: Number of supported media bus codes ··· 359 360 unsigned int max_width, unsigned int max_height) 360 361 { 361 362 struct vsp1_entity *entity = to_vsp1_entity(subdev); 362 - struct v4l2_subdev_state *config; 363 + struct v4l2_subdev_state *state; 363 364 struct v4l2_mbus_framefmt *format; 364 365 struct v4l2_rect *selection; 365 366 unsigned int i; ··· 367 368 368 369 mutex_lock(&entity->lock); 369 370 370 - config = vsp1_entity_get_pad_config(entity, sd_state, fmt->which); 371 - if (!config) { 371 + state = vsp1_entity_get_state(entity, sd_state, fmt->which); 372 + if (!state) { 372 373 ret = -EINVAL; 373 374 goto done; 374 375 } 375 376 376 - format = vsp1_entity_get_pad_format(entity, config, fmt->pad); 377 + format = vsp1_entity_get_pad_format(entity, state, fmt->pad); 377 378 378 379 if (fmt->pad == entity->source_pad) { 379 380 /* The output format can't be modified. */ ··· 401 402 fmt->format = *format; 402 403 403 404 /* Propagate the format to the source pad. */ 404 - format = vsp1_entity_get_pad_format(entity, config, entity->source_pad); 405 + format = vsp1_entity_get_pad_format(entity, state, entity->source_pad); 405 406 *format = fmt->format; 406 407 407 408 /* Reset the crop and compose rectangles. */ 408 - selection = vsp1_entity_get_pad_selection(entity, config, fmt->pad, 409 + selection = vsp1_entity_get_pad_selection(entity, state, fmt->pad, 409 410 V4L2_SEL_TGT_CROP); 410 411 selection->left = 0; 411 412 selection->top = 0; 412 413 selection->width = format->width; 413 414 selection->height = format->height; 414 415 415 - selection = vsp1_entity_get_pad_selection(entity, config, fmt->pad, 416 + selection = vsp1_entity_get_pad_selection(entity, state, fmt->pad, 416 417 V4L2_SEL_TGT_COMPOSE); 417 418 selection->left = 0; 418 419 selection->top = 0; ··· 669 670 vsp1_entity_init_cfg(subdev, NULL); 670 671 671 672 /* 672 - * Allocate the pad configuration to store formats and selection 673 + * Allocate the subdev state to store formats and selection 673 674 * rectangles. 674 675 */ 675 676 /* 676 677 * FIXME: Drop this call, drivers are not supposed to use 677 678 * __v4l2_subdev_state_alloc(). 678 679 */ 679 - entity->config = __v4l2_subdev_state_alloc(&entity->subdev, 680 - "vsp1:config->lock", &key); 681 - if (IS_ERR(entity->config)) { 680 + entity->state = __v4l2_subdev_state_alloc(&entity->subdev, 681 + "vsp1:state->lock", &key); 682 + if (IS_ERR(entity->state)) { 682 683 media_entity_cleanup(&entity->subdev.entity); 683 - return PTR_ERR(entity->config); 684 + return PTR_ERR(entity->state); 684 685 } 685 686 686 687 return 0; ··· 692 693 entity->ops->destroy(entity); 693 694 if (entity->subdev.ctrl_handler) 694 695 v4l2_ctrl_handler_free(entity->subdev.ctrl_handler); 695 - __v4l2_subdev_state_free(entity->config); 696 + __v4l2_subdev_state_free(entity->state); 696 697 media_entity_cleanup(&entity->subdev.entity); 697 698 }
+5 -5
drivers/media/platform/renesas/vsp1/vsp1_entity.h
··· 115 115 unsigned int sink_pad; 116 116 117 117 struct v4l2_subdev subdev; 118 - struct v4l2_subdev_state *config; 118 + struct v4l2_subdev_state *state; 119 119 120 - struct mutex lock; /* Protects the pad config */ 120 + struct mutex lock; /* Protects the state */ 121 121 }; 122 122 123 123 static inline struct vsp1_entity *to_vsp1_entity(struct v4l2_subdev *subdev) ··· 135 135 const struct media_pad *remote, u32 flags); 136 136 137 137 struct v4l2_subdev_state * 138 - vsp1_entity_get_pad_config(struct vsp1_entity *entity, 139 - struct v4l2_subdev_state *sd_state, 140 - enum v4l2_subdev_format_whence which); 138 + vsp1_entity_get_state(struct vsp1_entity *entity, 139 + struct v4l2_subdev_state *sd_state, 140 + enum v4l2_subdev_format_whence which); 141 141 struct v4l2_mbus_framefmt * 142 142 vsp1_entity_get_pad_format(struct vsp1_entity *entity, 143 143 struct v4l2_subdev_state *sd_state,
+2 -2
drivers/media/platform/renesas/vsp1/vsp1_hgo.c
··· 140 140 unsigned int hratio; 141 141 unsigned int vratio; 142 142 143 - crop = vsp1_entity_get_pad_selection(entity, entity->config, 143 + crop = vsp1_entity_get_pad_selection(entity, entity->state, 144 144 HISTO_PAD_SINK, V4L2_SEL_TGT_CROP); 145 - compose = vsp1_entity_get_pad_selection(entity, entity->config, 145 + compose = vsp1_entity_get_pad_selection(entity, entity->state, 146 146 HISTO_PAD_SINK, 147 147 V4L2_SEL_TGT_COMPOSE); 148 148
+2 -2
drivers/media/platform/renesas/vsp1/vsp1_hgt.c
··· 139 139 u8 upper; 140 140 unsigned int i; 141 141 142 - crop = vsp1_entity_get_pad_selection(entity, entity->config, 142 + crop = vsp1_entity_get_pad_selection(entity, entity->state, 143 143 HISTO_PAD_SINK, V4L2_SEL_TGT_CROP); 144 - compose = vsp1_entity_get_pad_selection(entity, entity->config, 144 + compose = vsp1_entity_get_pad_selection(entity, entity->state, 145 145 HISTO_PAD_SINK, 146 146 V4L2_SEL_TGT_COMPOSE); 147 147
+11 -13
drivers/media/platform/renesas/vsp1/vsp1_histo.c
··· 203 203 struct v4l2_subdev_selection *sel) 204 204 { 205 205 struct vsp1_histogram *histo = subdev_to_histo(subdev); 206 - struct v4l2_subdev_state *config; 206 + struct v4l2_subdev_state *state; 207 207 struct v4l2_mbus_framefmt *format; 208 208 struct v4l2_rect *crop; 209 209 int ret = 0; ··· 213 213 214 214 mutex_lock(&histo->entity.lock); 215 215 216 - config = vsp1_entity_get_pad_config(&histo->entity, sd_state, 217 - sel->which); 218 - if (!config) { 216 + state = vsp1_entity_get_state(&histo->entity, sd_state, sel->which); 217 + if (!state) { 219 218 ret = -EINVAL; 220 219 goto done; 221 220 } ··· 222 223 switch (sel->target) { 223 224 case V4L2_SEL_TGT_COMPOSE_BOUNDS: 224 225 case V4L2_SEL_TGT_COMPOSE_DEFAULT: 225 - crop = vsp1_entity_get_pad_selection(&histo->entity, config, 226 + crop = vsp1_entity_get_pad_selection(&histo->entity, state, 226 227 HISTO_PAD_SINK, 227 228 V4L2_SEL_TGT_CROP); 228 229 sel->r.left = 0; ··· 233 234 234 235 case V4L2_SEL_TGT_CROP_BOUNDS: 235 236 case V4L2_SEL_TGT_CROP_DEFAULT: 236 - format = vsp1_entity_get_pad_format(&histo->entity, config, 237 + format = vsp1_entity_get_pad_format(&histo->entity, state, 237 238 HISTO_PAD_SINK); 238 239 sel->r.left = 0; 239 240 sel->r.top = 0; ··· 243 244 244 245 case V4L2_SEL_TGT_COMPOSE: 245 246 case V4L2_SEL_TGT_CROP: 246 - sel->r = *vsp1_entity_get_pad_selection(&histo->entity, config, 247 + sel->r = *vsp1_entity_get_pad_selection(&histo->entity, state, 247 248 sel->pad, sel->target); 248 249 break; 249 250 ··· 345 346 struct v4l2_subdev_selection *sel) 346 347 { 347 348 struct vsp1_histogram *histo = subdev_to_histo(subdev); 348 - struct v4l2_subdev_state *config; 349 + struct v4l2_subdev_state *state; 349 350 int ret; 350 351 351 352 if (sel->pad != HISTO_PAD_SINK) ··· 353 354 354 355 mutex_lock(&histo->entity.lock); 355 356 356 - config = vsp1_entity_get_pad_config(&histo->entity, sd_state, 357 - sel->which); 358 - if (!config) { 357 + state = vsp1_entity_get_state(&histo->entity, sd_state, sel->which); 358 + if (!state) { 359 359 ret = -EINVAL; 360 360 goto done; 361 361 } 362 362 363 363 if (sel->target == V4L2_SEL_TGT_CROP) 364 - ret = histo_set_crop(subdev, config, sel); 364 + ret = histo_set_crop(subdev, state, sel); 365 365 else if (sel->target == V4L2_SEL_TGT_COMPOSE) 366 - ret = histo_set_compose(subdev, config, sel); 366 + ret = histo_set_compose(subdev, state, sel); 367 367 else 368 368 ret = -EINVAL; 369 369
+5 -6
drivers/media/platform/renesas/vsp1/vsp1_hsit.c
··· 66 66 struct v4l2_subdev_format *fmt) 67 67 { 68 68 struct vsp1_hsit *hsit = to_hsit(subdev); 69 - struct v4l2_subdev_state *config; 69 + struct v4l2_subdev_state *state; 70 70 struct v4l2_mbus_framefmt *format; 71 71 int ret = 0; 72 72 73 73 mutex_lock(&hsit->entity.lock); 74 74 75 - config = vsp1_entity_get_pad_config(&hsit->entity, sd_state, 76 - fmt->which); 77 - if (!config) { 75 + state = vsp1_entity_get_state(&hsit->entity, sd_state, fmt->which); 76 + if (!state) { 78 77 ret = -EINVAL; 79 78 goto done; 80 79 } 81 80 82 - format = vsp1_entity_get_pad_format(&hsit->entity, config, fmt->pad); 81 + format = vsp1_entity_get_pad_format(&hsit->entity, state, fmt->pad); 83 82 84 83 if (fmt->pad == HSIT_PAD_SOURCE) { 85 84 /* ··· 101 102 fmt->format = *format; 102 103 103 104 /* Propagate the format to the source pad. */ 104 - format = vsp1_entity_get_pad_format(&hsit->entity, config, 105 + format = vsp1_entity_get_pad_format(&hsit->entity, state, 105 106 HSIT_PAD_SOURCE); 106 107 *format = fmt->format; 107 108 format->code = hsit->inverse ? MEDIA_BUS_FMT_ARGB8888_1X32
+1 -1
drivers/media/platform/renesas/vsp1/vsp1_lif.c
··· 94 94 unsigned int obth; 95 95 unsigned int lbth; 96 96 97 - format = vsp1_entity_get_pad_format(&lif->entity, lif->entity.config, 97 + format = vsp1_entity_get_pad_format(&lif->entity, lif->entity.state, 98 98 LIF_PAD_SOURCE); 99 99 100 100 switch (entity->vsp1->version & VI6_IP_VERSION_MODEL_MASK) {
+4 -4
drivers/media/platform/renesas/vsp1/vsp1_rpf.c
··· 81 81 82 82 /* Format */ 83 83 sink_format = vsp1_entity_get_pad_format(&rpf->entity, 84 - rpf->entity.config, 84 + rpf->entity.state, 85 85 RWPF_PAD_SINK); 86 86 source_format = vsp1_entity_get_pad_format(&rpf->entity, 87 - rpf->entity.config, 87 + rpf->entity.state, 88 88 RWPF_PAD_SOURCE); 89 89 90 90 infmt = VI6_RPF_INFMT_CIPM ··· 158 158 const struct v4l2_rect *compose; 159 159 160 160 compose = vsp1_entity_get_pad_selection(pipe->brx, 161 - pipe->brx->config, 161 + pipe->brx->state, 162 162 rpf->brx_input, 163 163 V4L2_SEL_TGT_COMPOSE); 164 164 left = compose->left; ··· 302 302 * offsets are needed, as planes 2 and 3 always have identical 303 303 * strides. 304 304 */ 305 - crop = *vsp1_rwpf_get_crop(rpf, rpf->entity.config); 305 + crop = *vsp1_rwpf_get_crop(rpf, rpf->entity.state); 306 306 307 307 /* 308 308 * Partition Algorithm Control
+17 -20
drivers/media/platform/renesas/vsp1/vsp1_rwpf.c
··· 61 61 struct v4l2_subdev_format *fmt) 62 62 { 63 63 struct vsp1_rwpf *rwpf = to_rwpf(subdev); 64 - struct v4l2_subdev_state *config; 64 + struct v4l2_subdev_state *state; 65 65 struct v4l2_mbus_framefmt *format; 66 66 int ret = 0; 67 67 68 68 mutex_lock(&rwpf->entity.lock); 69 69 70 - config = vsp1_entity_get_pad_config(&rwpf->entity, sd_state, 71 - fmt->which); 72 - if (!config) { 70 + state = vsp1_entity_get_state(&rwpf->entity, sd_state, fmt->which); 71 + if (!state) { 73 72 ret = -EINVAL; 74 73 goto done; 75 74 } ··· 79 80 fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32) 80 81 fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32; 81 82 82 - format = vsp1_entity_get_pad_format(&rwpf->entity, config, fmt->pad); 83 + format = vsp1_entity_get_pad_format(&rwpf->entity, state, fmt->pad); 83 84 84 85 if (fmt->pad == RWPF_PAD_SOURCE) { 85 86 /* ··· 105 106 struct v4l2_rect *crop; 106 107 107 108 /* Update the sink crop rectangle. */ 108 - crop = vsp1_rwpf_get_crop(rwpf, config); 109 + crop = vsp1_rwpf_get_crop(rwpf, state); 109 110 crop->left = 0; 110 111 crop->top = 0; 111 112 crop->width = fmt->format.width; ··· 113 114 } 114 115 115 116 /* Propagate the format to the source pad. */ 116 - format = vsp1_entity_get_pad_format(&rwpf->entity, config, 117 + format = vsp1_entity_get_pad_format(&rwpf->entity, state, 117 118 RWPF_PAD_SOURCE); 118 119 *format = fmt->format; 119 120 ··· 132 133 struct v4l2_subdev_selection *sel) 133 134 { 134 135 struct vsp1_rwpf *rwpf = to_rwpf(subdev); 135 - struct v4l2_subdev_state *config; 136 + struct v4l2_subdev_state *state; 136 137 struct v4l2_mbus_framefmt *format; 137 138 int ret = 0; 138 139 ··· 145 146 146 147 mutex_lock(&rwpf->entity.lock); 147 148 148 - config = vsp1_entity_get_pad_config(&rwpf->entity, sd_state, 149 - sel->which); 150 - if (!config) { 149 + state = vsp1_entity_get_state(&rwpf->entity, sd_state, sel->which); 150 + if (!state) { 151 151 ret = -EINVAL; 152 152 goto done; 153 153 } 154 154 155 155 switch (sel->target) { 156 156 case V4L2_SEL_TGT_CROP: 157 - sel->r = *vsp1_rwpf_get_crop(rwpf, config); 157 + sel->r = *vsp1_rwpf_get_crop(rwpf, state); 158 158 break; 159 159 160 160 case V4L2_SEL_TGT_CROP_BOUNDS: 161 - format = vsp1_entity_get_pad_format(&rwpf->entity, config, 161 + format = vsp1_entity_get_pad_format(&rwpf->entity, state, 162 162 RWPF_PAD_SINK); 163 163 sel->r.left = 0; 164 164 sel->r.top = 0; ··· 180 182 struct v4l2_subdev_selection *sel) 181 183 { 182 184 struct vsp1_rwpf *rwpf = to_rwpf(subdev); 183 - struct v4l2_subdev_state *config; 185 + struct v4l2_subdev_state *state; 184 186 struct v4l2_mbus_framefmt *format; 185 187 struct v4l2_rect *crop; 186 188 int ret = 0; ··· 197 199 198 200 mutex_lock(&rwpf->entity.lock); 199 201 200 - config = vsp1_entity_get_pad_config(&rwpf->entity, sd_state, 201 - sel->which); 202 - if (!config) { 202 + state = vsp1_entity_get_state(&rwpf->entity, sd_state, sel->which); 203 + if (!state) { 203 204 ret = -EINVAL; 204 205 goto done; 205 206 } 206 207 207 208 /* Make sure the crop rectangle is entirely contained in the image. */ 208 - format = vsp1_entity_get_pad_format(&rwpf->entity, config, 209 + format = vsp1_entity_get_pad_format(&rwpf->entity, state, 209 210 RWPF_PAD_SINK); 210 211 211 212 /* ··· 225 228 sel->r.height = min_t(unsigned int, sel->r.height, 226 229 format->height - sel->r.top); 227 230 228 - crop = vsp1_rwpf_get_crop(rwpf, config); 231 + crop = vsp1_rwpf_get_crop(rwpf, state); 229 232 *crop = sel->r; 230 233 231 234 /* Propagate the format to the source pad. */ 232 - format = vsp1_entity_get_pad_format(&rwpf->entity, config, 235 + format = vsp1_entity_get_pad_format(&rwpf->entity, state, 233 236 RWPF_PAD_SOURCE); 234 237 format->width = crop->width; 235 238 format->height = crop->height;
+17 -19
drivers/media/platform/renesas/vsp1/vsp1_sru.c
··· 123 123 struct v4l2_subdev_frame_size_enum *fse) 124 124 { 125 125 struct vsp1_sru *sru = to_sru(subdev); 126 - struct v4l2_subdev_state *config; 126 + struct v4l2_subdev_state *state; 127 127 struct v4l2_mbus_framefmt *format; 128 128 int ret = 0; 129 129 130 - config = vsp1_entity_get_pad_config(&sru->entity, sd_state, 131 - fse->which); 132 - if (!config) 130 + state = vsp1_entity_get_state(&sru->entity, sd_state, fse->which); 131 + if (!state) 133 132 return -EINVAL; 134 133 135 - format = vsp1_entity_get_pad_format(&sru->entity, config, SRU_PAD_SINK); 134 + format = vsp1_entity_get_pad_format(&sru->entity, state, SRU_PAD_SINK); 136 135 137 136 mutex_lock(&sru->entity.lock); 138 137 ··· 220 221 struct v4l2_subdev_format *fmt) 221 222 { 222 223 struct vsp1_sru *sru = to_sru(subdev); 223 - struct v4l2_subdev_state *config; 224 + struct v4l2_subdev_state *state; 224 225 struct v4l2_mbus_framefmt *format; 225 226 int ret = 0; 226 227 227 228 mutex_lock(&sru->entity.lock); 228 229 229 - config = vsp1_entity_get_pad_config(&sru->entity, sd_state, 230 - fmt->which); 231 - if (!config) { 230 + state = vsp1_entity_get_state(&sru->entity, sd_state, fmt->which); 231 + if (!state) { 232 232 ret = -EINVAL; 233 233 goto done; 234 234 } 235 235 236 - sru_try_format(sru, config, fmt->pad, &fmt->format); 236 + sru_try_format(sru, state, fmt->pad, &fmt->format); 237 237 238 - format = vsp1_entity_get_pad_format(&sru->entity, config, fmt->pad); 238 + format = vsp1_entity_get_pad_format(&sru->entity, state, fmt->pad); 239 239 *format = fmt->format; 240 240 241 241 if (fmt->pad == SRU_PAD_SINK) { 242 242 /* Propagate the format to the source pad. */ 243 - format = vsp1_entity_get_pad_format(&sru->entity, config, 243 + format = vsp1_entity_get_pad_format(&sru->entity, state, 244 244 SRU_PAD_SOURCE); 245 245 *format = fmt->format; 246 246 247 - sru_try_format(sru, config, SRU_PAD_SOURCE, format); 247 + sru_try_format(sru, state, SRU_PAD_SOURCE, format); 248 248 } 249 249 250 250 done: ··· 278 280 struct v4l2_mbus_framefmt *output; 279 281 u32 ctrl0; 280 282 281 - input = vsp1_entity_get_pad_format(&sru->entity, sru->entity.config, 283 + input = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state, 282 284 SRU_PAD_SINK); 283 - output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.config, 285 + output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state, 284 286 SRU_PAD_SOURCE); 285 287 286 288 if (input->code == MEDIA_BUS_FMT_ARGB8888_1X32) ··· 308 310 struct v4l2_mbus_framefmt *input; 309 311 struct v4l2_mbus_framefmt *output; 310 312 311 - input = vsp1_entity_get_pad_format(&sru->entity, sru->entity.config, 313 + input = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state, 312 314 SRU_PAD_SINK); 313 - output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.config, 315 + output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state, 314 316 SRU_PAD_SOURCE); 315 317 316 318 /* ··· 334 336 struct v4l2_mbus_framefmt *input; 335 337 struct v4l2_mbus_framefmt *output; 336 338 337 - input = vsp1_entity_get_pad_format(&sru->entity, sru->entity.config, 339 + input = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state, 338 340 SRU_PAD_SINK); 339 - output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.config, 341 + output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state, 340 342 SRU_PAD_SOURCE); 341 343 342 344 /* Adapt if SRUx2 is enabled. */
+18 -21
drivers/media/platform/renesas/vsp1/vsp1_uds.c
··· 128 128 struct v4l2_subdev_frame_size_enum *fse) 129 129 { 130 130 struct vsp1_uds *uds = to_uds(subdev); 131 - struct v4l2_subdev_state *config; 131 + struct v4l2_subdev_state *state; 132 132 struct v4l2_mbus_framefmt *format; 133 133 int ret = 0; 134 134 135 - config = vsp1_entity_get_pad_config(&uds->entity, sd_state, 136 - fse->which); 137 - if (!config) 135 + state = vsp1_entity_get_state(&uds->entity, sd_state, fse->which); 136 + if (!state) 138 137 return -EINVAL; 139 138 140 - format = vsp1_entity_get_pad_format(&uds->entity, config, 141 - UDS_PAD_SINK); 139 + format = vsp1_entity_get_pad_format(&uds->entity, state, UDS_PAD_SINK); 142 140 143 141 mutex_lock(&uds->entity.lock); 144 142 ··· 203 205 struct v4l2_subdev_format *fmt) 204 206 { 205 207 struct vsp1_uds *uds = to_uds(subdev); 206 - struct v4l2_subdev_state *config; 208 + struct v4l2_subdev_state *state; 207 209 struct v4l2_mbus_framefmt *format; 208 210 int ret = 0; 209 211 210 212 mutex_lock(&uds->entity.lock); 211 213 212 - config = vsp1_entity_get_pad_config(&uds->entity, sd_state, 213 - fmt->which); 214 - if (!config) { 214 + state = vsp1_entity_get_state(&uds->entity, sd_state, fmt->which); 215 + if (!state) { 215 216 ret = -EINVAL; 216 217 goto done; 217 218 } 218 219 219 - uds_try_format(uds, config, fmt->pad, &fmt->format); 220 + uds_try_format(uds, state, fmt->pad, &fmt->format); 220 221 221 - format = vsp1_entity_get_pad_format(&uds->entity, config, fmt->pad); 222 + format = vsp1_entity_get_pad_format(&uds->entity, state, fmt->pad); 222 223 *format = fmt->format; 223 224 224 225 if (fmt->pad == UDS_PAD_SINK) { 225 226 /* Propagate the format to the source pad. */ 226 - format = vsp1_entity_get_pad_format(&uds->entity, config, 227 + format = vsp1_entity_get_pad_format(&uds->entity, state, 227 228 UDS_PAD_SOURCE); 228 229 *format = fmt->format; 229 230 230 - uds_try_format(uds, config, UDS_PAD_SOURCE, format); 231 + uds_try_format(uds, state, UDS_PAD_SOURCE, format); 231 232 } 232 233 233 234 done: ··· 266 269 unsigned int vscale; 267 270 bool multitap; 268 271 269 - input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config, 272 + input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state, 270 273 UDS_PAD_SINK); 271 - output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config, 274 + output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state, 272 275 UDS_PAD_SOURCE); 273 276 274 277 hscale = uds_compute_ratio(input->width, output->width); ··· 311 314 struct vsp1_partition *partition = pipe->partition; 312 315 const struct v4l2_mbus_framefmt *output; 313 316 314 - output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config, 317 + output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state, 315 318 UDS_PAD_SOURCE); 316 319 317 320 /* Input size clipping. */ ··· 336 339 const struct v4l2_mbus_framefmt *input; 337 340 unsigned int hscale; 338 341 339 - input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config, 342 + input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state, 340 343 UDS_PAD_SINK); 341 - output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config, 344 + output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state, 342 345 UDS_PAD_SOURCE); 343 346 hscale = output->width / input->width; 344 347 ··· 378 381 partition->uds_sink = *window; 379 382 partition->uds_source = *window; 380 383 381 - input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config, 384 + input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state, 382 385 UDS_PAD_SINK); 383 - output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config, 386 + output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state, 384 387 UDS_PAD_SOURCE); 385 388 386 389 partition->uds_sink.width = window->width * input->width
+11 -13
drivers/media/platform/renesas/vsp1/vsp1_uif.c
··· 86 86 struct v4l2_subdev_selection *sel) 87 87 { 88 88 struct vsp1_uif *uif = to_uif(subdev); 89 - struct v4l2_subdev_state *config; 89 + struct v4l2_subdev_state *state; 90 90 struct v4l2_mbus_framefmt *format; 91 91 int ret = 0; 92 92 ··· 95 95 96 96 mutex_lock(&uif->entity.lock); 97 97 98 - config = vsp1_entity_get_pad_config(&uif->entity, sd_state, 99 - sel->which); 100 - if (!config) { 98 + state = vsp1_entity_get_state(&uif->entity, sd_state, sel->which); 99 + if (!state) { 101 100 ret = -EINVAL; 102 101 goto done; 103 102 } ··· 104 105 switch (sel->target) { 105 106 case V4L2_SEL_TGT_CROP_BOUNDS: 106 107 case V4L2_SEL_TGT_CROP_DEFAULT: 107 - format = vsp1_entity_get_pad_format(&uif->entity, config, 108 + format = vsp1_entity_get_pad_format(&uif->entity, state, 108 109 UIF_PAD_SINK); 109 110 sel->r.left = 0; 110 111 sel->r.top = 0; ··· 113 114 break; 114 115 115 116 case V4L2_SEL_TGT_CROP: 116 - sel->r = *vsp1_entity_get_pad_selection(&uif->entity, config, 117 + sel->r = *vsp1_entity_get_pad_selection(&uif->entity, state, 117 118 sel->pad, sel->target); 118 119 break; 119 120 ··· 132 133 struct v4l2_subdev_selection *sel) 133 134 { 134 135 struct vsp1_uif *uif = to_uif(subdev); 135 - struct v4l2_subdev_state *config; 136 + struct v4l2_subdev_state *state; 136 137 struct v4l2_mbus_framefmt *format; 137 138 struct v4l2_rect *selection; 138 139 int ret = 0; ··· 143 144 144 145 mutex_lock(&uif->entity.lock); 145 146 146 - config = vsp1_entity_get_pad_config(&uif->entity, sd_state, 147 - sel->which); 148 - if (!config) { 147 + state = vsp1_entity_get_state(&uif->entity, sd_state, sel->which); 148 + if (!state) { 149 149 ret = -EINVAL; 150 150 goto done; 151 151 } 152 152 153 153 /* The crop rectangle must be inside the input frame. */ 154 - format = vsp1_entity_get_pad_format(&uif->entity, config, UIF_PAD_SINK); 154 + format = vsp1_entity_get_pad_format(&uif->entity, state, UIF_PAD_SINK); 155 155 156 156 sel->r.left = clamp_t(unsigned int, sel->r.left, 0, format->width - 1); 157 157 sel->r.top = clamp_t(unsigned int, sel->r.top, 0, format->height - 1); ··· 160 162 format->height - sel->r.top); 161 163 162 164 /* Store the crop rectangle. */ 163 - selection = vsp1_entity_get_pad_selection(&uif->entity, config, 165 + selection = vsp1_entity_get_pad_selection(&uif->entity, state, 164 166 sel->pad, V4L2_SEL_TGT_CROP); 165 167 *selection = sel->r; 166 168 ··· 204 206 vsp1_uif_write(uif, dlb, VI6_UIF_DISCOM_DOCMPMR, 205 207 VI6_UIF_DISCOM_DOCMPMR_SEL(9)); 206 208 207 - crop = vsp1_entity_get_pad_selection(entity, entity->config, 209 + crop = vsp1_entity_get_pad_selection(entity, entity->state, 208 210 UIF_PAD_SINK, V4L2_SEL_TGT_CROP); 209 211 210 212 left = crop->left;
+2 -2
drivers/media/platform/renesas/vsp1/vsp1_video.c
··· 198 198 * at the WPF sink. 199 199 */ 200 200 format = vsp1_entity_get_pad_format(&pipe->output->entity, 201 - pipe->output->entity.config, 201 + pipe->output->entity.state, 202 202 RWPF_PAD_SINK); 203 203 204 204 /* A single partition simply processes the output size in full. */ ··· 263 263 * at the WPF sink. 264 264 */ 265 265 format = vsp1_entity_get_pad_format(&pipe->output->entity, 266 - pipe->output->entity.config, 266 + pipe->output->entity.state, 267 267 RWPF_PAD_SINK); 268 268 div_size = format->width; 269 269
+5 -5
drivers/media/platform/renesas/vsp1/vsp1_wpf.c
··· 66 66 } 67 67 68 68 sink_format = vsp1_entity_get_pad_format(&wpf->entity, 69 - wpf->entity.config, 69 + wpf->entity.state, 70 70 RWPF_PAD_SINK); 71 71 source_format = vsp1_entity_get_pad_format(&wpf->entity, 72 - wpf->entity.config, 72 + wpf->entity.state, 73 73 RWPF_PAD_SOURCE); 74 74 75 75 mutex_lock(&wpf->entity.lock); ··· 246 246 int ret; 247 247 248 248 sink_format = vsp1_entity_get_pad_format(&wpf->entity, 249 - wpf->entity.config, 249 + wpf->entity.state, 250 250 RWPF_PAD_SINK); 251 251 source_format = vsp1_entity_get_pad_format(&wpf->entity, 252 - wpf->entity.config, 252 + wpf->entity.state, 253 253 RWPF_PAD_SOURCE); 254 254 255 255 /* Format */ ··· 384 384 unsigned int i; 385 385 386 386 sink_format = vsp1_entity_get_pad_format(&wpf->entity, 387 - wpf->entity.config, 387 + wpf->entity.state, 388 388 RWPF_PAD_SINK); 389 389 width = sink_format->width; 390 390 height = sink_format->height;