Skip to content

Commit

Permalink
drm/display: Move DSC header and helpers into display-helper module
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Thomas Zimmermann committed Apr 25, 2022
1 parent 5d1b8b4 commit 2a64b14
Showing 19 changed files with 46 additions and 24 deletions.
6 changes: 3 additions & 3 deletions Documentation/gpu/drm-kms-helpers.rst
Original file line number Diff line number Diff line change
@@ -326,13 +326,13 @@ MIPI DSI Helper Functions Reference
Display Stream Compression Helper Functions Reference
=====================================================

.. kernel-doc:: drivers/gpu/drm/drm_dsc.c
.. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c
:doc: dsc helpers

.. kernel-doc:: include/drm/drm_dsc.h
.. kernel-doc:: include/drm/display/drm_dsc.h
:internal:

.. kernel-doc:: drivers/gpu/drm/drm_dsc.c
.. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c
:export:

Output Probing Helper Functions Reference
2 changes: 1 addition & 1 deletion drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o
#

drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
drm_dsc.o drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \
drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \
drm_probe_helper.o \
drm_plane_helper.o drm_atomic_helper.o \
drm_kms_helper_common.o \
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
Original file line number Diff line number Diff line change
@@ -23,6 +23,8 @@
*
*/

#include <drm/display/drm_dsc_helper.h>

#include "reg_helper.h"
#include "dcn20_dsc.h"
#include "dsc/dscc_types.h"
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.h
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@

#include "dsc.h"
#include "dsc/dscc_types.h"
#include <drm/drm_dsc.h>
#include <drm/display/drm_dsc.h>

#define TO_DCN20_DSC(dsc)\
container_of(dsc, struct dcn20_dsc, base)
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.h
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
#define __RC_CALC_FPU_H__

#include "os_types.h"
#include <drm/drm_dsc.h>
#include <drm/display/drm_dsc.h>

#define QP_SET_SIZE 15

4 changes: 2 additions & 2 deletions drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
Original file line number Diff line number Diff line change
@@ -22,10 +22,10 @@
* Author: AMD
*/

#include <drm/drm_dsc.h>
#include <drm/display/drm_dp_helper.h>
#include <drm/display/drm_dsc_helper.h>
#include "dc_hw_types.h"
#include "dsc.h"
#include <drm/display/drm_dp_helper.h>
#include "dc.h"
#include "rc_calc.h"
#include "fixed31_32.h"
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/display/dc/dsc/dscc_types.h
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
#ifndef __DSCC_TYPES_H__
#define __DSCC_TYPES_H__

#include <drm/drm_dsc.h>
#include <drm/display/drm_dsc.h>

#ifndef NUM_BUF_RANGES
#define NUM_BUF_RANGES 15
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/display/dc/dsc/rc_calc_dpi.c
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
* Authors: AMD
*
*/
#include <drm/drm_dsc.h>
#include <drm/display/drm_dsc_helper.h>
#include "dscc_types.h"
#include "rc_calc.h"

3 changes: 2 additions & 1 deletion drivers/gpu/drm/display/Makefile
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@ obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o
drm_display_helper-y := drm_display_helper_mod.o
drm_display_helper-$(CONFIG_DRM_DISPLAY_DP_HELPER) += drm_dp_dual_mode_helper.o \
drm_dp_helper.o \
drm_dp_mst_topology.o
drm_dp_mst_topology.o \
drm_dsc_helper.o
drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o

Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@
#include <linux/byteorder/generic.h>

#include <drm/display/drm_dp_helper.h>
#include <drm/display/drm_dsc_helper.h>
#include <drm/drm_print.h>
#include <drm/drm_dsc.h>

/**
* DOC: dsc helpers
6 changes: 3 additions & 3 deletions drivers/gpu/drm/drm_mipi_dsi.c
Original file line number Diff line number Diff line change
@@ -25,16 +25,16 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#include <drm/drm_mipi_dsi.h>

#include <linux/device.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>

#include <drm/drm_dsc.h>
#include <drm/display/drm_dsc.h>
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_print.h>

#include <video/mipi_display.h>

/**
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/display/icl_dsi.c
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
* Jani Nikula <jani.nikula@intel.com>
*/

#include <drm/display/drm_dsc_helper.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_mipi_dsi.h>

1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/display/intel_bios.c
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
*/

#include <drm/display/drm_dp_helper.h>
#include <drm/display/drm_dsc_helper.h>

#include "display/intel_display.h"
#include "display/intel_display_types.h"
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/display/intel_display_types.h
Original file line number Diff line number Diff line change
@@ -33,9 +33,9 @@

#include <drm/display/drm_dp_dual_mode_helper.h>
#include <drm/display/drm_dp_mst_helper.h>
#include <drm/display/drm_dsc.h>
#include <drm/drm_atomic.h>
#include <drm/drm_crtc.h>
#include <drm/drm_dsc.h>
#include <drm/drm_encoder.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_probe_helper.h>
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/display/intel_dp.c
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@
#include <asm/byteorder.h>

#include <drm/display/drm_dp_helper.h>
#include <drm/display/drm_dsc_helper.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc.h>
#include <drm/drm_edid.h>
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/display/intel_qp_tables.c
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
* Copyright © 2021 Intel Corporation
*/

#include <drm/drm_dsc.h>
#include <drm/display/drm_dsc.h>

#include "i915_utils.h"
#include "intel_qp_tables.h"
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/display/intel_vdsc.c
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@
*/
#include <linux/limits.h>

#include <drm/display/drm_dsc_helper.h>

#include "i915_drv.h"
#include "intel_crtc.h"
#include "intel_de.h"
8 changes: 1 addition & 7 deletions include/drm/drm_dsc.h → include/drm/display/drm_dsc.h
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
#ifndef DRM_DSC_H_
#define DRM_DSC_H_

#include <drm/display/drm_dp_helper.h>
#include <drm/display/drm_dp.h>

/* VESA Display Stream Compression DSC 1.2 constants */
#define DSC_NUM_BUF_RANGES 15
@@ -602,10 +602,4 @@ struct drm_dsc_pps_infoframe {
struct drm_dsc_picture_parameter_set pps_payload;
} __packed;

void drm_dsc_dp_pps_header_init(struct dp_sdp_header *pps_header);
int drm_dsc_dp_rc_buffer_size(u8 rc_buffer_block_size, u8 rc_buffer_size);
void drm_dsc_pps_payload_pack(struct drm_dsc_picture_parameter_set *pps_sdp,
const struct drm_dsc_config *dsc_cfg);
int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);

#endif /* _DRM_DSC_H_ */
20 changes: 20 additions & 0 deletions include/drm/display/drm_dsc_helper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* SPDX-License-Identifier: MIT
* Copyright (C) 2018 Intel Corp.
*
* Authors:
* Manasi Navare <manasi.d.navare@intel.com>
*/

#ifndef DRM_DSC_HELPER_H_
#define DRM_DSC_HELPER_H_

#include <drm/display/drm_dsc.h>

void drm_dsc_dp_pps_header_init(struct dp_sdp_header *pps_header);
int drm_dsc_dp_rc_buffer_size(u8 rc_buffer_block_size, u8 rc_buffer_size);
void drm_dsc_pps_payload_pack(struct drm_dsc_picture_parameter_set *pps_sdp,
const struct drm_dsc_config *dsc_cfg);
int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);

#endif /* _DRM_DSC_HELPER_H_ */

0 comments on commit 2a64b14

Please sign in to comment.