Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 123be519 authored by Rajakumar Govindaram's avatar Rajakumar Govindaram Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera2: cpp: Extend interface for partial frames



The interface structures for partial frame processing needs
to be added in current frame structure. This change will
add necessary members so that userspace driver can make
use of this interface to schedule a partial frame payload.
This is an extension to existing interface so the same can
be used for full frame payload.

Change-Id: Ibadd01ea952504a1ee4e387997554c6725dde43a
Signed-off-by: default avatarRajakumar Govindaram <rajakuma@codeaurora.org>
parent 42e5b4a7
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -2616,6 +2616,14 @@ static struct msm_cpp_frame_info_t *get_64bit_cpp_frame_from_compat(
	new_frame->we_disable = new_frame32->we_disable;
	new_frame->duplicate_identity = new_frame32->duplicate_identity;
	new_frame->reserved = new_frame32->reserved;
	new_frame->partial_frame_indicator =
		new_frame32->partial_frame_indicator;
	new_frame->first_payload = new_frame32->first_payload;
	new_frame->last_payload = new_frame32->last_payload;
	new_frame->first_stripe_index = new_frame32->first_stripe_index;
	new_frame->last_stripe_index = new_frame32->last_stripe_index;
	new_frame->stripe_info_offset = new_frame32->stripe_info_offset;
	new_frame->stripe_info = new_frame32->stripe_info;

	/* Convert the 32 bit pointer to 64 bit pointer */
	new_frame->cookie = compat_ptr(new_frame32->cookie);
@@ -2690,6 +2698,13 @@ static void get_compat_frame_from_64bit(struct msm_cpp_frame_info_t *frame,
	k32_frame->duplicate_identity = frame->duplicate_identity;
	k32_frame->reserved = frame->reserved;
	k32_frame->cookie = ptr_to_compat(frame->cookie);
	k32_frame->partial_frame_indicator = frame->partial_frame_indicator;
	k32_frame->first_payload = frame->first_payload;
	k32_frame->last_payload = frame->last_payload;
	k32_frame->first_stripe_index = frame->first_stripe_index;
	k32_frame->last_stripe_index = frame->last_stripe_index;
	k32_frame->stripe_info_offset = frame->stripe_info_offset;
	k32_frame->stripe_info = frame->stripe_info;
}

static long msm_cpp_subdev_fops_compat_ioctl(struct file *file,
+42 −0
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@

/* Should be same as VIDEO_MAX_PLANES in videodev2.h */
#define MAX_PLANES VIDEO_MAX_PLANES
/* PARTIAL_FRAME_STRIPE_COUNT must be even */
#define PARTIAL_FRAME_STRIPE_COUNT 4

#define MAX_NUM_CPP_STRIPS 8
#define MSM_CPP_MAX_NUM_PLANES 3
@@ -197,6 +199,26 @@ struct msm_cpp_frame_info_t {
	struct msm_cpp_buffer_info_t output_buffer_info[2];
	struct msm_cpp_buffer_info_t tnr_scratch_buffer_info[2];
	uint32_t reserved;
	uint8_t partial_frame_indicator;
	/* the followings are used only for partial_frame type
	 * and is only used for offline frame processing and
	 * only if payload big enough and need to be split into partial_frame
	 * if first_payload, kernel acquires output buffer
	 * first payload must have the last stripe
	 * buffer addresses from 0 to last_stripe_index are updated.
	 * kernel updates payload with msg_len and stripe_info
	 * kernel sends top level, plane level, then only stripes
	 * starting with first_stripe_index and
	 * ends with last_stripe_index
	 * kernel then sends trailing flag at frame done,
	 * if last payload, kernel queues the output buffer to HAL
	 */
	uint8_t first_payload;
	uint8_t last_payload;
	uint32_t first_stripe_index;
	uint32_t last_stripe_index;
	uint32_t stripe_info_offset;
	uint32_t stripe_info;
};

struct msm_cpp_pop_stream_info_t {
@@ -370,6 +392,26 @@ struct msm_cpp_frame_info32_t {
	struct msm_cpp_buffer_info_t output_buffer_info[2];
	struct msm_cpp_buffer_info_t tnr_scratch_buffer_info[2];
	uint32_t reserved;
	uint8_t partial_frame_indicator;
	/* the followings are used only for partial_frame type
	 * and is only used for offline frame processing and
	 * only if payload big enough and need to be split into partial_frame
	 * if first_payload, kernel acquires output buffer
	 * first payload must have the last stripe
	 * buffer addresses from 0 to last_stripe_index are updated.
	 * kernel updates payload with msg_len and stripe_info
	 * kernel sends top level, plane level, then only stripes
	 * starting with first_stripe_index and
	 * ends with last_stripe_index
	 * kernel then sends trailing flag at frame done,
	 * if last payload, kernel queues the output buffer to HAL
	 */
	uint8_t first_payload;
	uint8_t last_payload;
	uint32_t first_stripe_index;
	uint32_t last_stripe_index;
	uint32_t stripe_info_offset;
	uint32_t stripe_info;
};

struct msm_cpp_clock_settings32_t {