From 0ed72c557b47a8d52ee8d827b23eae204dad46c8 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 9 Oct 2022 14:45:02 +0200 Subject: [PATCH] media: atomisp: Add an ia_css_frame_dump() function Add an ia_css_frame_dump() function to dump various parameters from newly created frames and use this to dump info for frames created with ia_css_frame_map() (userptr backed frames). This is purely a debugging aid. Signed-off-by: Hans de Goede --- .../staging/media/atomisp/pci/ia_css_frame_public.h | 2 ++ .../media/atomisp/pci/runtime/frame/src/frame.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/staging/media/atomisp/pci/ia_css_frame_public.h b/drivers/staging/media/atomisp/pci/ia_css_frame_public.h index 5727bd1753307d..24f14591c80566 100644 --- a/drivers/staging/media/atomisp/pci/ia_css_frame_public.h +++ b/drivers/staging/media/atomisp/pci/ia_css_frame_public.h @@ -190,6 +190,8 @@ struct ia_css_frame { .flash_state = IA_CSS_FRAME_FLASH_STATE_NONE, \ } +void ia_css_frame_dump(struct ia_css_frame *frame); + /* @brief Fill a frame with zeros * * @param frame The frame. diff --git a/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c b/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c index c20a4527c842dc..2da27444f456d8 100644 --- a/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c +++ b/drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c @@ -88,6 +88,17 @@ ia_css_elems_bytes_from_info( ** CSS API functions, exposed by ia_css.h **************************************************************************/ +void ia_css_frame_dump(struct ia_css_frame *frame) +{ + if (!frame) + return; + + dev_dbg(atomisp_dev, "New frame %dx%d, format 0x%x padded-width %d raw_bit_depth %d valid %d dynamic_queue_id %d buf_type %d data %x data_bytes %d\n", + frame->info.res.width, frame->info.res.height, frame->info.format, + frame->info.padded_width, frame->info.raw_bit_depth, frame->valid, + frame->dynamic_queue_id, frame->buf_type, frame->data, frame->data_bytes); +} + void ia_css_frame_zero(struct ia_css_frame *frame) { assert(frame); @@ -183,6 +194,7 @@ int ia_css_frame_map(struct ia_css_frame **frame, *frame = me; + ia_css_frame_dump(*frame); return err; }