msm: drm: sde: Add support for FP16 via AHB programming
Introduce support for the FP16 format and FP16 color processing blocks. This includes support for FP16, FP16 UBWC, and inline rotation on tiled FP16 pixel data. Change-Id: I06a70cab5447140598682f687129d4f8662524b2 Signed-off-by: Christopher Braga <cbraga@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
5eb49ef15d
commit
9a5a42c453
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
|
||||
/*
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _MSM_DRM_PP_H_
|
||||
@@ -683,4 +683,40 @@ struct drm_msm_rc_mask_cfg {
|
||||
__u64 cfg_param_09[RC_DATA_SIZE_MAX];
|
||||
};
|
||||
|
||||
#define FP16_SUPPORTED
|
||||
#define FP16_GC_FLAG_ALPHA_EN (1 << 0)
|
||||
|
||||
/* FP16 GC mode options */
|
||||
#define FP16_GC_MODE_INVALID 0
|
||||
#define FP16_GC_MODE_SRGB 1
|
||||
#define FP16_GC_MODE_PQ 2
|
||||
|
||||
/**
|
||||
* struct drm_msm_fp16_gc - FP16 GC configuration structure
|
||||
* @in flags - Settings flags for FP16 GC
|
||||
* @in mode - Gamma correction mode to use for FP16 GC
|
||||
*/
|
||||
struct drm_msm_fp16_gc {
|
||||
__u64 flags;
|
||||
__u64 mode;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_msm_fp16_csc - FP16 CSC configuration structure
|
||||
* @in flags - Settings flags for FP16 CSC. Currently unused
|
||||
* @in cfg_param_0_len - Length of data for cfg_param_0
|
||||
* @in cfg_param_0 - Data for param 0. Max size is FP16_CSC_CFG0_PARAM_LEN
|
||||
* @in cfg_param_1_len - Length of data for cfg_param_1
|
||||
* @in cfg_param_1 - Data for param 1. Max size is FP16_CSC_CFG1_PARAM_LEN
|
||||
*/
|
||||
#define FP16_CSC_CFG0_PARAM_LEN 12
|
||||
#define FP16_CSC_CFG1_PARAM_LEN 8
|
||||
struct drm_msm_fp16_csc {
|
||||
__u64 flags;
|
||||
__u32 cfg_param_0_len;
|
||||
__u32 cfg_param_0[FP16_CSC_CFG0_PARAM_LEN];
|
||||
__u32 cfg_param_1_len;
|
||||
__u32 cfg_param_1[FP16_CSC_CFG1_PARAM_LEN];
|
||||
};
|
||||
|
||||
#endif /* _MSM_DRM_PP_H_ */
|
||||
|
@@ -64,6 +64,14 @@ extern "C" {
|
||||
*/
|
||||
#define DRM_FORMAT_MOD_QCOM_TILE fourcc_mod_code(QCOM, 0x8)
|
||||
|
||||
/**
|
||||
* @DRM_FORMAT_MOD_QCOM_ALPHA_SWAP: Refers to a pixel format for which
|
||||
* its alpha ordering has been reversed.
|
||||
* Implementation may be platform and
|
||||
* base-format specific.
|
||||
*/
|
||||
#define DRM_FORMAT_MOD_QCOM_ALPHA_SWAP fourcc_mod_code(QCOM, 0x10)
|
||||
|
||||
/**
|
||||
* Blend operations for "blend_op" property
|
||||
*
|
||||
|
@@ -765,6 +765,52 @@ enum mmm_color_fmts {
|
||||
* + UV_Stride * UV_Scanlines), 4096)
|
||||
*/
|
||||
MMM_COLOR_FMT_NV12_512,
|
||||
/* Venus RGBA FP16 UBWC:
|
||||
* Contains 2 planes in the following order -
|
||||
* (A) Meta plane
|
||||
* (B) RGBA plane
|
||||
*
|
||||
* <--- RGB_Meta_Stride ---->
|
||||
* <-------- Width ------>
|
||||
* M M M M M M M M M M M M . . ^ ^
|
||||
* M M M M M M M M M M M M . . | |
|
||||
* M M M M M M M M M M M M . . Height |
|
||||
* M M M M M M M M M M M M . . | Meta_RGB_Scanlines
|
||||
* M M M M M M M M M M M M . . | |
|
||||
* M M M M M M M M M M M M . . | |
|
||||
* M M M M M M M M M M M M . . | |
|
||||
* M M M M M M M M M M M M . . V |
|
||||
* . . . . . . . . . . . . . . |
|
||||
* . . . . . . . . . . . . . . |
|
||||
* . . . . . . . . . . . . . . -------> Buffer size aligned to 4k
|
||||
* . . . . . . . . . . . . . . V
|
||||
* <-------- RGB_Stride -------->
|
||||
* <------- Width ------->
|
||||
* R R R R R R R R R R R R . . . . ^ ^
|
||||
* R R R R R R R R R R R R . . . . | |
|
||||
* R R R R R R R R R R R R . . . . Height |
|
||||
* R R R R R R R R R R R R . . . . | RGB_Scanlines
|
||||
* R R R R R R R R R R R R . . . . | |
|
||||
* R R R R R R R R R R R R . . . . | |
|
||||
* R R R R R R R R R R R R . . . . | |
|
||||
* R R R R R R R R R R R R . . . . V |
|
||||
* . . . . . . . . . . . . . . . . |
|
||||
* . . . . . . . . . . . . . . . . |
|
||||
* . . . . . . . . . . . . . . . . -------> Buffer size aligned to 4k
|
||||
* . . . . . . . . . . . . . . . . V
|
||||
*
|
||||
* RGB_Stride = align(Width * 8, 256)
|
||||
* RGB_Scanlines = align(Height, 16)
|
||||
* RGB_Plane_size = align(RGB_Stride * RGB_Scanlines, 4096)
|
||||
* RGB_Meta_Stride = align(roundup(Width, RGB_TileWidth), 64)
|
||||
* RGB_Meta_Scanline = align(roundup(Height, RGB_TileHeight), 16)
|
||||
* RGB_Meta_Plane_size = align(RGB_Meta_Stride *
|
||||
* RGB_Meta_Scanlines, 4096)
|
||||
* RGB_TileWidth = 8 pixels across is 1 tile
|
||||
* RGB_TileHeight = 4 pixels
|
||||
* Total size = align(RGB_Meta_Plane_size + RGB_Plane_size, 4096)
|
||||
*/
|
||||
MMM_COLOR_FMT_RGBA16161616F_UBWC,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1087,6 +1133,10 @@ static inline unsigned int MMM_COLOR_FMT_RGB_STRIDE(unsigned int color_fmt,
|
||||
case MMM_COLOR_FMT_RGBA1010102_UBWC:
|
||||
alignment = 256;
|
||||
break;
|
||||
case MMM_COLOR_FMT_RGBA16161616F_UBWC:
|
||||
alignment = 256;
|
||||
bpp = 8;
|
||||
break;
|
||||
default:
|
||||
goto invalid_input;
|
||||
}
|
||||
@@ -1112,6 +1162,7 @@ static inline unsigned int MMM_COLOR_FMT_RGB_SCANLINES(unsigned int color_fmt,
|
||||
case MMM_COLOR_FMT_RGBA8888_UBWC:
|
||||
case MMM_COLOR_FMT_RGBA1010102_UBWC:
|
||||
case MMM_COLOR_FMT_RGB565_UBWC:
|
||||
case MMM_COLOR_FMT_RGBA16161616F_UBWC:
|
||||
alignment = 16;
|
||||
break;
|
||||
default:
|
||||
@@ -1138,6 +1189,9 @@ static inline unsigned int MMM_COLOR_FMT_RGB_META_STRIDE(unsigned int color_fmt,
|
||||
case MMM_COLOR_FMT_RGB565_UBWC:
|
||||
rgb_tile_width = 16;
|
||||
break;
|
||||
case MMM_COLOR_FMT_RGBA16161616F_UBWC:
|
||||
rgb_tile_width = 8;
|
||||
break;
|
||||
default:
|
||||
goto invalid_input;
|
||||
}
|
||||
@@ -1161,6 +1215,7 @@ static inline unsigned int MMM_COLOR_FMT_RGB_META_SCANLINES(
|
||||
case MMM_COLOR_FMT_RGBA8888_UBWC:
|
||||
case MMM_COLOR_FMT_RGBA1010102_UBWC:
|
||||
case MMM_COLOR_FMT_RGB565_UBWC:
|
||||
case MMM_COLOR_FMT_RGBA16161616F_UBWC:
|
||||
rgb_tile_height = 4;
|
||||
break;
|
||||
default:
|
||||
@@ -1307,6 +1362,7 @@ static inline unsigned int MMM_COLOR_FMT_BUFFER_SIZE(unsigned int color_fmt,
|
||||
case MMM_COLOR_FMT_RGBA8888_UBWC:
|
||||
case MMM_COLOR_FMT_RGBA1010102_UBWC:
|
||||
case MMM_COLOR_FMT_RGB565_UBWC:
|
||||
case MMM_COLOR_FMT_RGBA16161616F_UBWC:
|
||||
rgb_ubwc_plane = MMM_COLOR_FMT_ALIGN(rgb_stride * rgb_scanlines,
|
||||
4096);
|
||||
rgb_meta_stride = MMM_COLOR_FMT_RGB_META_STRIDE(color_fmt,
|
||||
|
Reference in New Issue
Block a user