disp: msm: add support for variable compression ratios
Currently the compression ratio is hard-coded to either 2:1 or 3:1 in several places. This is not sufficient for new compression algorithms as they can support higher compression ratios. Add support for calculating the compression ratios from the source and target bpp thereby eliminating hard-coding. Change-Id: I6383f3d0c781193d0a9ed74df5a95d8e856edb3d Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
This commit is contained in:

committad av
Gerrit - the friendly Code Review server

förälder
27844b7b60
incheckning
e3f23771ba
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (C) 2013 Red Hat
|
||||
* Author: Rob Clark <robdclark@gmail.com>
|
||||
*
|
||||
@@ -301,6 +301,28 @@ u32 msm_readl(const void __iomem *addr)
|
||||
return val;
|
||||
}
|
||||
|
||||
int msm_get_src_bpc(int chroma_format,
|
||||
int bpc)
|
||||
{
|
||||
int src_bpp;
|
||||
|
||||
switch (chroma_format) {
|
||||
case MSM_CHROMA_444:
|
||||
src_bpp = bpc * 3;
|
||||
break;
|
||||
case MSM_CHROMA_422:
|
||||
src_bpp = bpc * 2;
|
||||
break;
|
||||
case MSM_CHROMA_420:
|
||||
src_bpp = mult_frac(bpc, 3, 2);
|
||||
break;
|
||||
default:
|
||||
src_bpp = bpc * 3;
|
||||
break;
|
||||
}
|
||||
return src_bpp;
|
||||
}
|
||||
|
||||
struct vblank_work {
|
||||
struct kthread_work work;
|
||||
int crtc_id;
|
||||
|
Referens i nytt ärende
Block a user