Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/display: Move DSC header and helpers into display-helper module

DSC is the Display Stream Compression standard for DisplayPort. Move
the DSC code into display/ and split the header into files for protocol
core and DRM helpers. Adapt all users of the code. No functional
changes.

To avoid the proliferation of Kconfig options, DSC is part of DRM's
support for DisplayPort. If necessary, a new option could make DSC an
independent feature.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-6-tzimmermann@suse.de

+46 -24
+3 -3
Documentation/gpu/drm-kms-helpers.rst
··· 326 326 Display Stream Compression Helper Functions Reference 327 327 ===================================================== 328 328 329 - .. kernel-doc:: drivers/gpu/drm/drm_dsc.c 329 + .. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c 330 330 :doc: dsc helpers 331 331 332 - .. kernel-doc:: include/drm/drm_dsc.h 332 + .. kernel-doc:: include/drm/display/drm_dsc.h 333 333 :internal: 334 334 335 - .. kernel-doc:: drivers/gpu/drm/drm_dsc.c 335 + .. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c 336 336 :export: 337 337 338 338 Output Probing Helper Functions Reference
+1 -1
drivers/gpu/drm/Makefile
··· 58 58 # 59 59 60 60 drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \ 61 - drm_dsc.o drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \ 61 + drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \ 62 62 drm_probe_helper.o \ 63 63 drm_plane_helper.o drm_atomic_helper.o \ 64 64 drm_kms_helper_common.o \
+2
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
··· 23 23 * 24 24 */ 25 25 26 + #include <drm/display/drm_dsc_helper.h> 27 + 26 28 #include "reg_helper.h" 27 29 #include "dcn20_dsc.h" 28 30 #include "dsc/dscc_types.h"
+1 -1
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.h
··· 26 26 27 27 #include "dsc.h" 28 28 #include "dsc/dscc_types.h" 29 - #include <drm/drm_dsc.h> 29 + #include <drm/display/drm_dsc.h> 30 30 31 31 #define TO_DCN20_DSC(dsc)\ 32 32 container_of(dsc, struct dcn20_dsc, base)
+1 -1
drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.h
··· 27 27 #define __RC_CALC_FPU_H__ 28 28 29 29 #include "os_types.h" 30 - #include <drm/drm_dsc.h> 30 + #include <drm/display/drm_dsc.h> 31 31 32 32 #define QP_SET_SIZE 15 33 33
+2 -2
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
··· 22 22 * Author: AMD 23 23 */ 24 24 25 - #include <drm/drm_dsc.h> 25 + #include <drm/display/drm_dp_helper.h> 26 + #include <drm/display/drm_dsc_helper.h> 26 27 #include "dc_hw_types.h" 27 28 #include "dsc.h" 28 - #include <drm/display/drm_dp_helper.h> 29 29 #include "dc.h" 30 30 #include "rc_calc.h" 31 31 #include "fixed31_32.h"
+1 -1
drivers/gpu/drm/amd/display/dc/dsc/dscc_types.h
··· 26 26 #ifndef __DSCC_TYPES_H__ 27 27 #define __DSCC_TYPES_H__ 28 28 29 - #include <drm/drm_dsc.h> 29 + #include <drm/display/drm_dsc.h> 30 30 31 31 #ifndef NUM_BUF_RANGES 32 32 #define NUM_BUF_RANGES 15
+1 -1
drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c
··· 22 22 * Authors: AMD 23 23 * 24 24 */ 25 - #include <drm/drm_dsc.h> 25 + #include <drm/display/drm_dsc_helper.h> 26 26 #include "dscc_types.h" 27 27 #include "rc_calc.h" 28 28
+2 -1
drivers/gpu/drm/display/Makefile
··· 5 5 drm_display_helper-y := drm_display_helper_mod.o 6 6 drm_display_helper-$(CONFIG_DRM_DISPLAY_DP_HELPER) += drm_dp_dual_mode_helper.o \ 7 7 drm_dp_helper.o \ 8 - drm_dp_mst_topology.o 8 + drm_dp_mst_topology.o \ 9 + drm_dsc_helper.o 9 10 drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o 10 11 drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o 11 12
+1 -1
drivers/gpu/drm/drm_dsc.c drivers/gpu/drm/display/drm_dsc_helper.c
··· 13 13 #include <linux/byteorder/generic.h> 14 14 15 15 #include <drm/display/drm_dp_helper.h> 16 + #include <drm/display/drm_dsc_helper.h> 16 17 #include <drm/drm_print.h> 17 - #include <drm/drm_dsc.h> 18 18 19 19 /** 20 20 * DOC: dsc helpers
+3 -3
drivers/gpu/drm/drm_mipi_dsi.c
··· 25 25 * USE OR OTHER DEALINGS IN THE SOFTWARE. 26 26 */ 27 27 28 - #include <drm/drm_mipi_dsi.h> 29 - 30 28 #include <linux/device.h> 31 29 #include <linux/module.h> 32 30 #include <linux/of_device.h> 33 31 #include <linux/pm_runtime.h> 34 32 #include <linux/slab.h> 35 33 36 - #include <drm/drm_dsc.h> 34 + #include <drm/display/drm_dsc.h> 35 + #include <drm/drm_mipi_dsi.h> 37 36 #include <drm/drm_print.h> 37 + 38 38 #include <video/mipi_display.h> 39 39 40 40 /**
+1
drivers/gpu/drm/i915/display/icl_dsi.c
··· 25 25 * Jani Nikula <jani.nikula@intel.com> 26 26 */ 27 27 28 + #include <drm/display/drm_dsc_helper.h> 28 29 #include <drm/drm_atomic_helper.h> 29 30 #include <drm/drm_mipi_dsi.h> 30 31
+1
drivers/gpu/drm/i915/display/intel_bios.c
··· 26 26 */ 27 27 28 28 #include <drm/display/drm_dp_helper.h> 29 + #include <drm/display/drm_dsc_helper.h> 29 30 30 31 #include "display/intel_display.h" 31 32 #include "display/intel_display_types.h"
+1 -1
drivers/gpu/drm/i915/display/intel_display_types.h
··· 33 33 34 34 #include <drm/display/drm_dp_dual_mode_helper.h> 35 35 #include <drm/display/drm_dp_mst_helper.h> 36 + #include <drm/display/drm_dsc.h> 36 37 #include <drm/drm_atomic.h> 37 38 #include <drm/drm_crtc.h> 38 - #include <drm/drm_dsc.h> 39 39 #include <drm/drm_encoder.h> 40 40 #include <drm/drm_fourcc.h> 41 41 #include <drm/drm_probe_helper.h>
+1
drivers/gpu/drm/i915/display/intel_dp.c
··· 36 36 #include <asm/byteorder.h> 37 37 38 38 #include <drm/display/drm_dp_helper.h> 39 + #include <drm/display/drm_dsc_helper.h> 39 40 #include <drm/drm_atomic_helper.h> 40 41 #include <drm/drm_crtc.h> 41 42 #include <drm/drm_edid.h>
+1 -1
drivers/gpu/drm/i915/display/intel_qp_tables.c
··· 3 3 * Copyright © 2021 Intel Corporation 4 4 */ 5 5 6 - #include <drm/drm_dsc.h> 6 + #include <drm/display/drm_dsc.h> 7 7 8 8 #include "i915_utils.h" 9 9 #include "intel_qp_tables.h"
+2
drivers/gpu/drm/i915/display/intel_vdsc.c
··· 7 7 */ 8 8 #include <linux/limits.h> 9 9 10 + #include <drm/display/drm_dsc_helper.h> 11 + 10 12 #include "i915_drv.h" 11 13 #include "intel_crtc.h" 12 14 #include "intel_de.h"
+20
include/drm/display/drm_dsc_helper.h
··· 1 + /* SPDX-License-Identifier: MIT 2 + * Copyright (C) 2018 Intel Corp. 3 + * 4 + * Authors: 5 + * Manasi Navare <manasi.d.navare@intel.com> 6 + */ 7 + 8 + #ifndef DRM_DSC_HELPER_H_ 9 + #define DRM_DSC_HELPER_H_ 10 + 11 + #include <drm/display/drm_dsc.h> 12 + 13 + void drm_dsc_dp_pps_header_init(struct dp_sdp_header *pps_header); 14 + int drm_dsc_dp_rc_buffer_size(u8 rc_buffer_block_size, u8 rc_buffer_size); 15 + void drm_dsc_pps_payload_pack(struct drm_dsc_picture_parameter_set *pps_sdp, 16 + const struct drm_dsc_config *dsc_cfg); 17 + int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg); 18 + 19 + #endif /* _DRM_DSC_HELPER_H_ */ 20 +
+1 -7
include/drm/drm_dsc.h include/drm/display/drm_dsc.h
··· 8 8 #ifndef DRM_DSC_H_ 9 9 #define DRM_DSC_H_ 10 10 11 - #include <drm/display/drm_dp_helper.h> 11 + #include <drm/display/drm_dp.h> 12 12 13 13 /* VESA Display Stream Compression DSC 1.2 constants */ 14 14 #define DSC_NUM_BUF_RANGES 15 ··· 601 601 struct dp_sdp_header pps_header; 602 602 struct drm_dsc_picture_parameter_set pps_payload; 603 603 } __packed; 604 - 605 - void drm_dsc_dp_pps_header_init(struct dp_sdp_header *pps_header); 606 - int drm_dsc_dp_rc_buffer_size(u8 rc_buffer_block_size, u8 rc_buffer_size); 607 - void drm_dsc_pps_payload_pack(struct drm_dsc_picture_parameter_set *pps_sdp, 608 - const struct drm_dsc_config *dsc_cfg); 609 - int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg); 610 604 611 605 #endif /* _DRM_DSC_H_ */