mirror of
https://github.com/Fishwaldo/build.git
synced 2025-04-17 11:31:28 +00:00
* Attach Meson64 to mainline with a bunch of patches. Tested, but need further work. * Enable DVFS on N2 which sometimes works, sometime doesn't, cleanup * Enable beta targets for Meson64 kernel family * Bump with version
73 lines
2.6 KiB
Diff
73 lines
2.6 KiB
Diff
From 3de9146ab1ff32651e82b83094ce13f9408ec3e4 Mon Sep 17 00:00:00 2001
|
|
From: Maxime Jourdan <mjourdan@baylibre.com>
|
|
Date: Sun, 21 Oct 2018 15:15:26 +0200
|
|
Subject: [PATCH 14/17] media: meson: vdec: add helpers for lossless
|
|
framebuffer compression buffers
|
|
|
|
Add helpers to support the lossless framebuffer compression format that
|
|
will be used in HEVC & VP9 decoders when decoding 10bit content for
|
|
downsampling to 8bit NV12 and later proper compressed buffer support.
|
|
|
|
Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com>
|
|
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
|
---
|
|
drivers/staging/media/meson/vdec/vdec_helpers.c | 27 +++++++++++++++++++++++++
|
|
drivers/staging/media/meson/vdec/vdec_helpers.h | 4 ++++
|
|
2 files changed, 31 insertions(+)
|
|
|
|
diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.c b/drivers/staging/media/meson/vdec/vdec_helpers.c
|
|
index fc59d88..818064b6 100644
|
|
--- a/drivers/staging/media/meson/vdec/vdec_helpers.c
|
|
+++ b/drivers/staging/media/meson/vdec/vdec_helpers.c
|
|
@@ -50,6 +50,33 @@ void amvdec_write_parser(struct amvdec_core *core, u32 reg, u32 val)
|
|
}
|
|
EXPORT_SYMBOL_GPL(amvdec_write_parser);
|
|
|
|
+/* 4 KiB per 64x32 block */
|
|
+u32 amvdec_am21c_body_size(u32 width, u32 height)
|
|
+{
|
|
+ u32 width_64 = ALIGN(width, 64) / 64;
|
|
+ u32 height_32 = ALIGN(height, 32) / 32;
|
|
+
|
|
+ return SZ_4K * width_64 * height_32;
|
|
+}
|
|
+EXPORT_SYMBOL_GPL(amvdec_am21c_body_size);
|
|
+
|
|
+/* 32 bytes per 128x64 block */
|
|
+u32 amvdec_am21c_head_size(u32 width, u32 height)
|
|
+{
|
|
+ u32 width_128 = ALIGN(width, 128) / 128;
|
|
+ u32 height_64 = ALIGN(height, 64) / 64;
|
|
+
|
|
+ return 32 * width_128 * height_64;
|
|
+}
|
|
+EXPORT_SYMBOL_GPL(amvdec_am21c_head_size);
|
|
+
|
|
+u32 amvdec_am21c_size(u32 width, u32 height)
|
|
+{
|
|
+ return ALIGN(amvdec_am21c_body_size(width, height) +
|
|
+ amvdec_am21c_head_size(width, height), SZ_64K);
|
|
+}
|
|
+EXPORT_SYMBOL_GPL(amvdec_am21c_size);
|
|
+
|
|
static int canvas_alloc(struct amvdec_session *sess, u8 *canvas_id)
|
|
{
|
|
int ret;
|
|
diff --git a/drivers/staging/media/meson/vdec/vdec_helpers.h b/drivers/staging/media/meson/vdec/vdec_helpers.h
|
|
index 165e629..cfaed52 100644
|
|
--- a/drivers/staging/media/meson/vdec/vdec_helpers.h
|
|
+++ b/drivers/staging/media/meson/vdec/vdec_helpers.h
|
|
@@ -27,6 +27,10 @@ void amvdec_clear_dos_bits(struct amvdec_core *core, u32 reg, u32 val);
|
|
u32 amvdec_read_parser(struct amvdec_core *core, u32 reg);
|
|
void amvdec_write_parser(struct amvdec_core *core, u32 reg, u32 val);
|
|
|
|
+u32 amvdec_am21c_body_size(u32 width, u32 height);
|
|
+u32 amvdec_am21c_head_size(u32 width, u32 height);
|
|
+u32 amvdec_am21c_size(u32 width, u32 height);
|
|
+
|
|
/**
|
|
* amvdec_dst_buf_done_idx() - Signal that a buffer is done decoding
|
|
*
|
|
--
|
|
2.7.1
|
|
|