Skip to content

Commit 8c4094b

Browse files
Kuogee Hsiehlumag
authored andcommitted
drm/msm/dpu: add support for DSC encoder v1.2 engine
Add support for DSC 1.2 by providing the necessary hooks to program the DPU DSC 1.2 encoder. Changes in v3: -- fixed kernel test rebot report that "__iomem *off" is declared but not used at dpu_hw_dsc_config_1_2() -- unrolling thresh loops Changes in v4: -- delete DPU_DSC_HW_REV_1_1 -- delete off and used real register name directly Changes in v7: -- replace offset with sblk->enc.base -- replace ss with slice Changes in v8: -- fixed checkpatch warning Changes in v9: -- replaced __dsc_calc_ob_max_addr() with __dsc_calc_output_buf_max_addr() -- replaced variable num_ss with num_softslice -- remove inline from function declaration changes in v10: -- rewording text of changes in v9 -- replace DPU_DSC_NATIVE_422_EN with DPU_DSC_NATIVE_42x_EN -- replace drm_dsc_calculate_flatness_det_thresh() with drm_dsc_flatness_det_thresh() Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Patchwork: https://patchwork.freedesktop.org/patch/539500/ Link: https://lore.kernel.org/r/1685036458-22683-7-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
1 parent 1494193 commit 8c4094b

5 files changed

Lines changed: 436 additions & 4 deletions

File tree

drivers/gpu/drm/msm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ msm-$(CONFIG_DRM_MSM_DPU) += \
6565
disp/dpu1/dpu_hw_catalog.o \
6666
disp/dpu1/dpu_hw_ctl.o \
6767
disp/dpu1/dpu_hw_dsc.o \
68+
disp/dpu1/dpu_hw_dsc_1_2.o \
6869
disp/dpu1/dpu_hw_interrupts.o \
6970
disp/dpu1/dpu_hw_intf.o \
7071
disp/dpu1/dpu_hw_lm.o \

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
22
/*
3-
* Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved.
3+
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
44
* Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved.
55
*/
66

@@ -240,12 +240,18 @@ enum {
240240
};
241241

242242
/**
243-
* DSC features
243+
* DSC sub-blocks/features
244244
* @DPU_DSC_OUTPUT_CTRL Configure which PINGPONG block gets
245245
* the pixel output from this DSC.
246+
* @DPU_DSC_HW_REV_1_2 DSC block supports DSC 1.1 and 1.2
247+
* @DPU_DSC_NATIVE_42x_EN Supports NATIVE_422_EN and NATIVE_420_EN encoding
248+
* @DPU_DSC_MAX
246249
*/
247250
enum {
248251
DPU_DSC_OUTPUT_CTRL = 0x1,
252+
DPU_DSC_HW_REV_1_2,
253+
DPU_DSC_NATIVE_42x_EN,
254+
DPU_DSC_MAX
249255
};
250256

251257
/**
@@ -301,6 +307,14 @@ struct dpu_pp_blk {
301307
u32 version;
302308
};
303309

310+
/**
311+
* struct dpu_dsc_blk - DSC Encoder sub-blk information
312+
* @info: HW register and features supported by this sub-blk
313+
*/
314+
struct dpu_dsc_blk {
315+
DPU_HW_SUBBLK_INFO;
316+
};
317+
304318
/**
305319
* enum dpu_qos_lut_usage - define QoS LUT use cases
306320
*/
@@ -431,6 +445,16 @@ struct dpu_pingpong_sub_blks {
431445
struct dpu_pp_blk dither;
432446
};
433447

448+
/**
449+
* struct dpu_dsc_sub_blks - DSC sub-blks
450+
* @enc: DSC encoder sub-block
451+
* @ctl: DSC controller sub-block
452+
*/
453+
struct dpu_dsc_sub_blks {
454+
struct dpu_dsc_blk enc;
455+
struct dpu_dsc_blk ctl;
456+
};
457+
434458
/**
435459
* dpu_clk_ctrl_type - Defines top level clock control signals
436460
*/
@@ -585,10 +609,13 @@ struct dpu_merge_3d_cfg {
585609
* struct dpu_dsc_cfg - information of DSC blocks
586610
* @id enum identifying this block
587611
* @base register offset of this block
612+
* @len: length of hardware block
588613
* @features bit mask identifying sub-blocks/features
614+
* @sblk: sub-blocks information
589615
*/
590616
struct dpu_dsc_cfg {
591617
DPU_HW_BLK_INFO;
618+
const struct dpu_dsc_sub_blks *sblk;
592619
};
593620

594621
/**

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
2-
/* Copyright (c) 2020-2022, Linaro Limited */
2+
/*
3+
* Copyright (c) 2020-2022, Linaro Limited
4+
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved
5+
*/
36

47
#ifndef _DPU_HW_DSC_H
58
#define _DPU_HW_DSC_H
@@ -68,6 +71,15 @@ struct dpu_hw_dsc {
6871
struct dpu_hw_dsc *dpu_hw_dsc_init(const struct dpu_dsc_cfg *cfg,
6972
void __iomem *addr);
7073

74+
/**
75+
* dpu_hw_dsc_init_1_2() - initializes the v1.2 DSC hw driver object
76+
* @cfg: DSC catalog entry for which driver object is required
77+
* @addr: Mapped register io address of MDP
78+
* Returns: Error code or allocated dpu_hw_dsc context
79+
*/
80+
struct dpu_hw_dsc *dpu_hw_dsc_init_1_2(const struct dpu_dsc_cfg *cfg,
81+
void __iomem *addr);
82+
7183
/**
7284
* dpu_hw_dsc_destroy - destroys dsc driver context
7385
* @dsc: Pointer to dsc driver context returned by dpu_hw_dsc_init

0 commit comments

Comments
 (0)