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

Commit 00d44b5b authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Expose extradata size to userspace



Previously, the extradata size was included within VENUS_BUFFER_SIZE
and callers (primarily in userspace) wouldn't know how much extra
padding was added to the buffer size. Exposing it allows userspace to
query directly instead of doing guesswork.

Change-Id: I7f9701a4adfe364d757028514bdd4fa84402a995
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent 63704274
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -137,6 +137,18 @@ enum color_fmts {
	COLOR_FMT_NV12_MVTB,
};

static inline unsigned int VENUS_EXTRADATA_SIZE(int width, int height)
{
	(void)height;
	(void)width;

	/*
	 * In the future, calculate the size based on the w/h but just
	 * hardcode it for now since 8K satisfies all current usecases.
	 */
	return 8 * 1024;
}

static inline unsigned int VENUS_Y_STRIDE(int color_fmt, int width)
{
	unsigned int alignment, stride = 0;
@@ -220,7 +232,7 @@ invalid_input:
static inline unsigned int VENUS_BUFFER_SIZE(
	int color_fmt, int width, int height)
{
	const unsigned int extra_size = 8*1024;
	const unsigned int extra_size = VENUS_EXTRADATA_SIZE(width, height);
	unsigned int uv_alignment = 0, size = 0;
	unsigned int y_plane, uv_plane, y_stride,
		uv_stride, y_sclines, uv_sclines;