Skip to content

Commit

Permalink
mfc: Reduce QoS boosting from Samsung hacks
Browse files Browse the repository at this point in the history
By default, everything is set to 240fps for optimal playback performance
However, the situation is not always true, as it applies to cases when
the video bitrate isn't necessarily high, causing high power consumption

Reduce and limit the boosting needed. For decoder, only apply for UHD
video resolution

Original commit: diepquynh/android_kernel_samsung_universal8895@9f3a1c7

Signed-off-by: celtare21 <[email protected]>
  • Loading branch information
celtare21 committed Dec 16, 2022
1 parent 554f354 commit f33472a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/media/platform/exynos/mfc/mfc_qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,6 @@ void mfc_qos_update_last_framerate(struct mfc_ctx *ctx, u64 timestamp)
ctx->last_framerate = __mfc_qos_get_fps_by_timestamp(ctx, &time);
if (ctx->last_framerate > MFC_MAX_FPS)
ctx->last_framerate = MFC_MAX_FPS;
ctx->last_framerate = (ctx->qos_ratio * ctx->last_framerate) / 100;
if (!(ctx->type == MFCINST_DECODER && !IS_UHD_RES(ctx)))
ctx->last_framerate = (ctx->qos_ratio * ctx->last_framerate) / 100;
}
2 changes: 1 addition & 1 deletion drivers/media/platform/exynos/mfc/mfc_qos.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static inline int __mfc_timespec64_compare(const struct timespec64 *lhs, const s
static inline void mfc_qos_reset_framerate(struct mfc_ctx *ctx)
{
if (ctx->type == MFCINST_DECODER)
ctx->framerate = DEC_DEFAULT_FPS;
ctx->framerate = 60000; // 60fps
else if (ctx->type == MFCINST_ENCODER)
ctx->framerate = ENC_DEFAULT_FPS;
}
Expand Down

0 comments on commit f33472a

Please sign in to comment.