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

Configure Feed

Select the types of activity you want to include in your feed.

drm/display: Move SCDC helpers into display-helper library

SCDC is the Status and Control Data Channel for HDMI. Move the SCDC
helpers into display/ and split the header into files for core and
helpers. Update all affected drivers. No functional changes.

To avoid the proliferation of Kconfig options, SCDC is part of DRM's
support for HDMI. If necessary, a new option could make SCDC 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-9-tzimmermann@suse.de

+97 -63
+3 -3
Documentation/gpu/drm-kms-helpers.rst
··· 356 356 SCDC Helper Functions Reference 357 357 =============================== 358 358 359 - .. kernel-doc:: drivers/gpu/drm/drm_scdc_helper.c 359 + .. kernel-doc:: drivers/gpu/drm/display/drm_scdc_helper.c 360 360 :doc: scdc helpers 361 361 362 - .. kernel-doc:: include/drm/drm_scdc_helper.h 362 + .. kernel-doc:: include/drm/display/drm_scdc_helper.h 363 363 :internal: 364 364 365 - .. kernel-doc:: drivers/gpu/drm/drm_scdc_helper.c 365 + .. kernel-doc:: drivers/gpu/drm/display/drm_scdc_helper.c 366 366 :export: 367 367 368 368 HDMI Infoframes Helper Reference
+1 -1
drivers/gpu/drm/Makefile
··· 63 63 drm_plane_helper.o drm_atomic_helper.o \ 64 64 drm_kms_helper_common.o \ 65 65 drm_simple_kms_helper.o drm_modeset_helper.o \ 66 - drm_scdc_helper.o drm_gem_atomic_helper.o \ 66 + drm_gem_atomic_helper.o \ 67 67 drm_gem_framebuffer_helper.o \ 68 68 drm_atomic_state_helper.o drm_damage_helper.o \ 69 69 drm_format_helper.o drm_self_refresh_helper.o drm_rect.o
+1 -1
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
··· 26 26 27 27 #include <drm/bridge/dw_hdmi.h> 28 28 #include <drm/display/drm_hdmi_helper.h> 29 + #include <drm/display/drm_scdc_helper.h> 29 30 #include <drm/drm_atomic.h> 30 31 #include <drm/drm_atomic_helper.h> 31 32 #include <drm/drm_bridge.h> 32 33 #include <drm/drm_of.h> 33 34 #include <drm/drm_print.h> 34 35 #include <drm/drm_probe_helper.h> 35 - #include <drm/drm_scdc_helper.h> 36 36 37 37 #include "dw-hdmi-audio.h" 38 38 #include "dw-hdmi-cec.h"
+2 -1
drivers/gpu/drm/display/Makefile
··· 8 8 drm_dp_mst_topology.o \ 9 9 drm_dsc_helper.o 10 10 drm_display_helper-$(CONFIG_DRM_DISPLAY_HDCP_HELPER) += drm_hdcp_helper.o 11 - drm_display_helper-$(CONFIG_DRM_DISPLAY_HDMI_HELPER) += drm_hdmi_helper.o 11 + drm_display_helper-$(CONFIG_DRM_DISPLAY_HDMI_HELPER) += drm_hdmi_helper.o \ 12 + drm_scdc_helper.o 12 13 drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o 13 14 drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o 14 15
-1
drivers/gpu/drm/drm_edid.c
··· 42 42 #include <drm/drm_edid.h> 43 43 #include <drm/drm_encoder.h> 44 44 #include <drm/drm_print.h> 45 - #include <drm/drm_scdc_helper.h> 46 45 47 46 #include "drm_crtc_internal.h" 48 47
+2 -1
drivers/gpu/drm/drm_scdc_helper.c drivers/gpu/drm/display/drm_scdc_helper.c
··· 21 21 * DEALINGS IN THE SOFTWARE. 22 22 */ 23 23 24 + #include <linux/i2c.h> 24 25 #include <linux/slab.h> 25 26 #include <linux/delay.h> 26 27 28 + #include <drm/display/drm_scdc_helper.h> 27 29 #include <drm/drm_print.h> 28 - #include <drm/drm_scdc_helper.h> 29 30 30 31 /** 31 32 * DOC: scdc helpers
+1 -1
drivers/gpu/drm/i915/display/intel_ddi.c
··· 27 27 28 28 #include <linux/string_helpers.h> 29 29 30 + #include <drm/display/drm_scdc_helper.h> 30 31 #include <drm/drm_privacy_screen_consumer.h> 31 - #include <drm/drm_scdc_helper.h> 32 32 33 33 #include "i915_drv.h" 34 34 #include "intel_audio.h"
+1 -1
drivers/gpu/drm/i915/display/intel_hdmi.c
··· 34 34 35 35 #include <drm/display/drm_hdcp_helper.h> 36 36 #include <drm/display/drm_hdmi_helper.h> 37 + #include <drm/display/drm_scdc_helper.h> 37 38 #include <drm/drm_atomic_helper.h> 38 39 #include <drm/drm_crtc.h> 39 40 #include <drm/drm_edid.h> 40 - #include <drm/drm_scdc_helper.h> 41 41 #include <drm/intel_lpe_audio.h> 42 42 43 43 #include "i915_debugfs.h"
+1
drivers/gpu/drm/nouveau/Kconfig
··· 5 5 select IOMMU_API 6 6 select FW_LOADER 7 7 select DRM_DISPLAY_DP_HELPER 8 + select DRM_DISPLAY_HDMI_HELPER 8 9 select DRM_DISPLAY_HELPER 9 10 select DRM_KMS_HELPER 10 11 select DRM_TTM
+1 -1
drivers/gpu/drm/nouveau/dispnv50/disp.c
··· 34 34 #include <linux/iopoll.h> 35 35 36 36 #include <drm/display/drm_dp_helper.h> 37 + #include <drm/display/drm_scdc_helper.h> 37 38 #include <drm/drm_atomic.h> 38 39 #include <drm/drm_atomic_helper.h> 39 40 #include <drm/drm_edid.h> 40 41 #include <drm/drm_fb_helper.h> 41 42 #include <drm/drm_plane_helper.h> 42 43 #include <drm/drm_probe_helper.h> 43 - #include <drm/drm_scdc_helper.h> 44 44 #include <drm/drm_vblank.h> 45 45 46 46 #include <nvif/push507c.h>
+1
drivers/gpu/drm/tegra/Kconfig
··· 6 6 depends on DRM 7 7 depends on OF 8 8 select DRM_DISPLAY_DP_HELPER 9 + select DRM_DISPLAY_HDMI_HELPER 9 10 select DRM_DISPLAY_HELPER 10 11 select DRM_DP_AUX_BUS 11 12 select DRM_KMS_HELPER
+1 -1
drivers/gpu/drm/tegra/sor.c
··· 17 17 #include <soc/tegra/pmc.h> 18 18 19 19 #include <drm/display/drm_dp_helper.h> 20 + #include <drm/display/drm_scdc_helper.h> 20 21 #include <drm/drm_atomic_helper.h> 21 22 #include <drm/drm_debugfs.h> 22 23 #include <drm/drm_file.h> 23 24 #include <drm/drm_panel.h> 24 - #include <drm/drm_scdc_helper.h> 25 25 #include <drm/drm_simple_kms_helper.h> 26 26 27 27 #include "dc.h"
+1 -1
drivers/gpu/drm/vc4/vc4_hdmi.c
··· 32 32 */ 33 33 34 34 #include <drm/display/drm_hdmi_helper.h> 35 + #include <drm/display/drm_scdc_helper.h> 35 36 #include <drm/drm_atomic_helper.h> 36 37 #include <drm/drm_probe_helper.h> 37 38 #include <drm/drm_simple_kms_helper.h> 38 - #include <drm/drm_scdc_helper.h> 39 39 #include <linux/clk.h> 40 40 #include <linux/component.h> 41 41 #include <linux/i2c.h>
+79
include/drm/display/drm_scdc_helper.h
··· 1 + /* 2 + * Copyright (c) 2015 NVIDIA Corporation. All rights reserved. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sub license, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice (including the 12 + * next paragraph) shall be included in all copies or substantial portions 13 + * of the Software. 14 + * 15 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 18 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 + * DEALINGS IN THE SOFTWARE. 22 + */ 23 + 24 + #ifndef DRM_SCDC_HELPER_H 25 + #define DRM_SCDC_HELPER_H 26 + 27 + #include <linux/types.h> 28 + 29 + #include <drm/display/drm_scdc.h> 30 + 31 + struct i2c_adapter; 32 + 33 + ssize_t drm_scdc_read(struct i2c_adapter *adapter, u8 offset, void *buffer, 34 + size_t size); 35 + ssize_t drm_scdc_write(struct i2c_adapter *adapter, u8 offset, 36 + const void *buffer, size_t size); 37 + 38 + /** 39 + * drm_scdc_readb - read a single byte from SCDC 40 + * @adapter: I2C adapter 41 + * @offset: offset of register to read 42 + * @value: return location for the register value 43 + * 44 + * Reads a single byte from SCDC. This is a convenience wrapper around the 45 + * drm_scdc_read() function. 46 + * 47 + * Returns: 48 + * 0 on success or a negative error code on failure. 49 + */ 50 + static inline int drm_scdc_readb(struct i2c_adapter *adapter, u8 offset, 51 + u8 *value) 52 + { 53 + return drm_scdc_read(adapter, offset, value, sizeof(*value)); 54 + } 55 + 56 + /** 57 + * drm_scdc_writeb - write a single byte to SCDC 58 + * @adapter: I2C adapter 59 + * @offset: offset of register to read 60 + * @value: return location for the register value 61 + * 62 + * Writes a single byte to SCDC. This is a convenience wrapper around the 63 + * drm_scdc_write() function. 64 + * 65 + * Returns: 66 + * 0 on success or a negative error code on failure. 67 + */ 68 + static inline int drm_scdc_writeb(struct i2c_adapter *adapter, u8 offset, 69 + u8 value) 70 + { 71 + return drm_scdc_write(adapter, offset, &value, sizeof(value)); 72 + } 73 + 74 + bool drm_scdc_get_scrambling_status(struct i2c_adapter *adapter); 75 + 76 + bool drm_scdc_set_scrambling(struct i2c_adapter *adapter, bool enable); 77 + bool drm_scdc_set_high_tmds_clock_ratio(struct i2c_adapter *adapter, bool set); 78 + 79 + #endif
+2 -50
include/drm/drm_scdc_helper.h include/drm/display/drm_scdc.h
··· 21 21 * DEALINGS IN THE SOFTWARE. 22 22 */ 23 23 24 - #ifndef DRM_SCDC_HELPER_H 25 - #define DRM_SCDC_HELPER_H 26 - 27 - #include <linux/i2c.h> 28 - #include <linux/types.h> 24 + #ifndef DRM_SCDC_H 25 + #define DRM_SCDC_H 29 26 30 27 #define SCDC_SINK_VERSION 0x01 31 28 ··· 85 88 #define SCDC_MANUFACTURER_SPECIFIC 0xde 86 89 #define SCDC_MANUFACTURER_SPECIFIC_SIZE 34 87 90 88 - ssize_t drm_scdc_read(struct i2c_adapter *adapter, u8 offset, void *buffer, 89 - size_t size); 90 - ssize_t drm_scdc_write(struct i2c_adapter *adapter, u8 offset, 91 - const void *buffer, size_t size); 92 - 93 - /** 94 - * drm_scdc_readb - read a single byte from SCDC 95 - * @adapter: I2C adapter 96 - * @offset: offset of register to read 97 - * @value: return location for the register value 98 - * 99 - * Reads a single byte from SCDC. This is a convenience wrapper around the 100 - * drm_scdc_read() function. 101 - * 102 - * Returns: 103 - * 0 on success or a negative error code on failure. 104 - */ 105 - static inline int drm_scdc_readb(struct i2c_adapter *adapter, u8 offset, 106 - u8 *value) 107 - { 108 - return drm_scdc_read(adapter, offset, value, sizeof(*value)); 109 - } 110 - 111 - /** 112 - * drm_scdc_writeb - write a single byte to SCDC 113 - * @adapter: I2C adapter 114 - * @offset: offset of register to read 115 - * @value: return location for the register value 116 - * 117 - * Writes a single byte to SCDC. This is a convenience wrapper around the 118 - * drm_scdc_write() function. 119 - * 120 - * Returns: 121 - * 0 on success or a negative error code on failure. 122 - */ 123 - static inline int drm_scdc_writeb(struct i2c_adapter *adapter, u8 offset, 124 - u8 value) 125 - { 126 - return drm_scdc_write(adapter, offset, &value, sizeof(value)); 127 - } 128 - 129 - bool drm_scdc_get_scrambling_status(struct i2c_adapter *adapter); 130 - 131 - bool drm_scdc_set_scrambling(struct i2c_adapter *adapter, bool enable); 132 - bool drm_scdc_set_high_tmds_clock_ratio(struct i2c_adapter *adapter, bool set); 133 91 #endif