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

Commit e12205e0 authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Align width & height to 16 prior to calculating the load



NUM_MBS_PER_SEC assumes that the input width and height is already
aligned to 16.  However, callers of this macro don't necessarily ensure
this.  This leads to bugs especially with resolutions such as 1080p for
which the height can be 1080 or 1088.  Hence, instead of making the
assumption, align both parameters to 16 (i.e. macroblock dimensions)
prior to calculating the load.

Change-Id: Ic386d5cdf55fc9549e37439f4586e20c85719e87
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent 2049a6cf
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -59,13 +59,11 @@

#define EXTRADATA_IDX(__num_planes) (__num_planes - 1)

#define NUM_MBS_PER_SEC(__height, __width, __fps) ({\
	(__height / 16) * (__width  / 16) * __fps; \
})
#define NUM_MBS_PER_SEC(__height, __width, __fps) \
	(NUM_MBS_PER_FRAME(__height, __width) * __fps)

#define NUM_MBS_PER_FRAME(__height, __width) ({\
	((__height + 15) >> 4) * ((__width + 15) >> 4); \
})
#define NUM_MBS_PER_FRAME(__height, __width) \
	((ALIGN(__height, 16) / 16) * (ALIGN(__width, 16) / 16))

/* Default threshold to reduce the core frequency */
#define DCVS_NOMINAL_THRESHOLD 8