Lines Matching refs:vscaler

146 	struct vimc_scaler_device *vscaler = v4l2_get_subdevdata(sd);  in vimc_scaler_set_fmt()  local
150 if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE && vscaler->src_frame) in vimc_scaler_set_fmt()
245 struct vimc_scaler_device *vscaler = v4l2_get_subdevdata(sd); in vimc_scaler_set_selection() local
253 if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE && vscaler->src_frame) in vimc_scaler_set_selection()
275 struct vimc_scaler_device *vscaler = v4l2_get_subdevdata(sd); in vimc_scaler_s_stream() local
283 if (vscaler->src_frame) in vimc_scaler_s_stream()
290 vscaler->hw.sink_fmt = *format; in vimc_scaler_s_stream()
291 vscaler->hw.bpp = vimc_pix_map_by_code(format->code)->bpp; in vimc_scaler_s_stream()
295 vscaler->hw.src_fmt = *format; in vimc_scaler_s_stream()
296 frame_size = format->width * format->height * vscaler->hw.bpp; in vimc_scaler_s_stream()
299 vscaler->hw.sink_crop = *rect; in vimc_scaler_s_stream()
307 vscaler->src_frame = vmalloc(frame_size); in vimc_scaler_s_stream()
308 if (!vscaler->src_frame) in vimc_scaler_s_stream()
311 if (!vscaler->src_frame) in vimc_scaler_s_stream()
314 vfree(vscaler->src_frame); in vimc_scaler_s_stream()
315 vscaler->src_frame = NULL; in vimc_scaler_s_stream()
334 static void vimc_scaler_fill_src_frame(const struct vimc_scaler_device *const vscaler, in vimc_scaler_fill_src_frame() argument
337 const struct v4l2_mbus_framefmt *sink_fmt = &vscaler->hw.sink_fmt; in vimc_scaler_fill_src_frame()
338 const struct v4l2_mbus_framefmt *src_fmt = &vscaler->hw.src_fmt; in vimc_scaler_fill_src_frame()
339 const struct v4l2_rect *r = &vscaler->hw.sink_crop; in vimc_scaler_fill_src_frame()
341 u8 *walker = vscaler->src_frame; in vimc_scaler_fill_src_frame()
348 y_offset = snk_y * sink_fmt->width * vscaler->hw.bpp; in vimc_scaler_fill_src_frame()
354 x_offset = snk_x * vscaler->hw.bpp; in vimc_scaler_fill_src_frame()
356 memcpy(walker, &sink_frame[index], vscaler->hw.bpp); in vimc_scaler_fill_src_frame()
357 walker += vscaler->hw.bpp; in vimc_scaler_fill_src_frame()
365 struct vimc_scaler_device *vscaler = container_of(ved, struct vimc_scaler_device, in vimc_scaler_process_frame() local
369 if (!vscaler->src_frame) in vimc_scaler_process_frame()
372 vimc_scaler_fill_src_frame(vscaler, sink_frame); in vimc_scaler_process_frame()
374 return vscaler->src_frame; in vimc_scaler_process_frame()
379 struct vimc_scaler_device *vscaler = in vimc_scaler_release() local
382 v4l2_subdev_cleanup(&vscaler->sd); in vimc_scaler_release()
383 media_entity_cleanup(vscaler->ved.ent); in vimc_scaler_release()
384 kfree(vscaler); in vimc_scaler_release()
391 struct vimc_scaler_device *vscaler; in vimc_scaler_add() local
395 vscaler = kzalloc(sizeof(*vscaler), GFP_KERNEL); in vimc_scaler_add()
396 if (!vscaler) in vimc_scaler_add()
400 vscaler->pads[VIMC_SCALER_SINK].flags = MEDIA_PAD_FL_SINK; in vimc_scaler_add()
401 vscaler->pads[VIMC_SCALER_SRC].flags = MEDIA_PAD_FL_SOURCE; in vimc_scaler_add()
403 ret = vimc_ent_sd_register(&vscaler->ved, &vscaler->sd, v4l2_dev, in vimc_scaler_add()
406 vscaler->pads, &vimc_scaler_internal_ops, in vimc_scaler_add()
409 kfree(vscaler); in vimc_scaler_add()
413 vscaler->ved.process_frame = vimc_scaler_process_frame; in vimc_scaler_add()
414 vscaler->ved.dev = vimc->mdev.dev; in vimc_scaler_add()
416 return &vscaler->ved; in vimc_scaler_add()