Skip to content

Commit

Permalink
media: atomisp: Add an ia_css_frame_dump() function
Browse files Browse the repository at this point in the history
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 <hdegoede@redhat.com>
  • Loading branch information
jwrdegoede committed Oct 9, 2022
1 parent 9a8cf42 commit 0ed72c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/media/atomisp/pci/ia_css_frame_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 12 additions & 0 deletions drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -183,6 +194,7 @@ int ia_css_frame_map(struct ia_css_frame **frame,

*frame = me;

ia_css_frame_dump(*frame);
return err;
}

Expand Down

0 comments on commit 0ed72c5

Please sign in to comment.