disp: msm: sde: add cache hints support in fb

Add a cache_flag in msm_fb object to store the system cache state hints.
Writeback connector will store cache write hints if system cache write
is enabled while HW is writing into this buffer. Plane in the primary
display path, in a 2-pass composition strategy will use this cache hints
to enable the display HW to use system cache for reading the pixel data
from this buffer.

Change-Id: Iff92a453a36d4a60b5a0162832eebd5e8739b5c3
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
This commit is contained in:
Veera Sundaram Sankaran
2021-07-22 10:53:48 -07:00
parent 993f61c91d
commit 7cb040c3a6
4 changed files with 57 additions and 8 deletions

View File

@@ -29,6 +29,8 @@
struct msm_framebuffer {
struct drm_framebuffer base;
const struct msm_format *format;
u32 cache_flags;
u32 cache_type;
};
#define to_msm_framebuffer(x) container_of(x, struct msm_framebuffer, base)
@@ -281,3 +283,29 @@ fail:
return ERR_PTR(ret);
}
void msm_framebuffer_set_cache_hint(struct drm_framebuffer *fb, u32 flags, u32 type)
{
struct msm_framebuffer *msm_fb;
if (!fb)
return;
msm_fb = to_msm_framebuffer(fb);
msm_fb->cache_flags = flags;
msm_fb->cache_type = type;
}
void msm_framebuffer_get_cache_hint(struct drm_framebuffer *fb, u32 *flags, u32 *type)
{
struct msm_framebuffer *msm_fb;
if (!fb) {
*flags = 0;
*type = 0;
return;
}
msm_fb = to_msm_framebuffer(fb);
*flags = msm_fb->cache_flags;
*type = msm_fb->cache_type;
}