Skip to content

Commit 7781cc4

Browse files
committed
Merge tag 'drm-misc-next-2024-02-29' of https://anongit.freedesktop.org/git/drm/drm-misc into drm-next
drm-misc-next for v6.9: UAPI Changes: Cross-subsystem Changes: backlight: - corgi: include backlight header fbdev: - Cleanup includes in public header file - fbtft: Include backlight header Core Changes: edid: - Remove built-in EDID data dp: - Avoid AUX transfers on powered-down displays - Add VSC SDP helpers modesetting: - Add sanity checks for polling - Cleanups scheduler: - Cleanups tests: - Add helpers for mode-setting tests Driver Changes: i915: - Use shared VSC SDP helper mgag200: - Work around PCI write bursts mxsfb: - Use managed mode config nouveau: - Include backlight header where necessary qiac: - Cleanups sun4: - HDMI: updates to atomic mode setting tegra: - Fix GEM refounting in error paths tidss: - Fix multi display - Fix initial Z position v3d: - Support display MMU page size Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240229084806.GA21616@localhost.localdomain
2 parents 9929095 + 8df1ddb commit 7781cc4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+700
-944
lines changed

Documentation/admin-guide/edid.rst

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,4 @@ restrictions later on.
2424
As a remedy for such situations, the kernel configuration item
2525
CONFIG_DRM_LOAD_EDID_FIRMWARE was introduced. It allows to provide an
2626
individually prepared or corrected EDID data set in the /lib/firmware
27-
directory from where it is loaded via the firmware interface. The code
28-
(see drivers/gpu/drm/drm_edid_load.c) contains built-in data sets for
29-
commonly used screen resolutions (800x600, 1024x768, 1280x1024, 1600x1200,
30-
1680x1050, 1920x1080) as binary blobs, but the kernel source tree does
31-
not contain code to create these data. In order to elucidate the origin
32-
of the built-in binary EDID blobs and to facilitate the creation of
33-
individual data for a specific misbehaving monitor, commented sources
34-
and a Makefile environment are given here.
35-
36-
To create binary EDID and C source code files from the existing data
37-
material, simply type "make" in tools/edid/.
38-
39-
If you want to create your own EDID file, copy the file 1024x768.S,
40-
replace the settings with your own data and add a new target to the
41-
Makefile. Please note that the EDID data structure expects the timing
42-
values in a different way as compared to the standard X11 format.
43-
44-
X11:
45-
HTimings:
46-
hdisp hsyncstart hsyncend htotal
47-
VTimings:
48-
vdisp vsyncstart vsyncend vtotal
49-
50-
EDID::
51-
52-
#define XPIX hdisp
53-
#define XBLANK htotal-hdisp
54-
#define XOFFSET hsyncstart-hdisp
55-
#define XPULSE hsyncend-hsyncstart
56-
57-
#define YPIX vdisp
58-
#define YBLANK vtotal-vdisp
59-
#define YOFFSET vsyncstart-vdisp
60-
#define YPULSE vsyncend-vsyncstart
27+
directory from where it is loaded via the firmware interface.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,16 +1162,10 @@
11621162
panels may send no or incorrect EDID data sets.
11631163
This parameter allows to specify an EDID data sets
11641164
in the /lib/firmware directory that are used instead.
1165-
Generic built-in EDID data sets are used, if one of
1166-
edid/1024x768.bin, edid/1280x1024.bin,
1167-
edid/1680x1050.bin, or edid/1920x1080.bin is given
1168-
and no file with the same name exists. Details and
1169-
instructions how to build your own EDID data are
1170-
available in Documentation/admin-guide/edid.rst. An EDID
1171-
data set will only be used for a particular connector,
1172-
if its name and a colon are prepended to the EDID
1173-
name. Each connector may use a unique EDID data
1174-
set by separating the files with a comma. An EDID
1165+
An EDID data set will only be used for a particular
1166+
connector, if its name and a colon are prepended to
1167+
the EDID name. Each connector may use a unique EDID
1168+
data set by separating the files with a comma. An EDID
11751169
data set with no connector name will be used for
11761170
any connectors not explicitly specified.
11771171

drivers/accel/qaic/mhi_controller.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static unsigned int mhi_timeout_ms = 2000; /* 2 sec default */
2020
module_param(mhi_timeout_ms, uint, 0600);
2121
MODULE_PARM_DESC(mhi_timeout_ms, "MHI controller timeout value");
2222

23-
static struct mhi_channel_config aic100_channels[] = {
23+
static const struct mhi_channel_config aic100_channels[] = {
2424
{
2525
.name = "QAIC_LOOPBACK",
2626
.num = 0,

drivers/gpu/drm/display/drm_dp_helper.c

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,15 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,
532532

533533
mutex_lock(&aux->hw_mutex);
534534

535+
/*
536+
* If the device attached to the aux bus is powered down then there's
537+
* no reason to attempt a transfer. Error out immediately.
538+
*/
539+
if (aux->powered_down) {
540+
ret = -EBUSY;
541+
goto unlock;
542+
}
543+
535544
/*
536545
* The specification doesn't give any recommendation on how often to
537546
* retry native transactions. We used to retry 7 times like for
@@ -599,6 +608,29 @@ int drm_dp_dpcd_probe(struct drm_dp_aux *aux, unsigned int offset)
599608
}
600609
EXPORT_SYMBOL(drm_dp_dpcd_probe);
601610

611+
/**
612+
* drm_dp_dpcd_set_powered() - Set whether the DP device is powered
613+
* @aux: DisplayPort AUX channel; for convenience it's OK to pass NULL here
614+
* and the function will be a no-op.
615+
* @powered: true if powered; false if not
616+
*
617+
* If the endpoint device on the DP AUX bus is known to be powered down
618+
* then this function can be called to make future transfers fail immediately
619+
* instead of needing to time out.
620+
*
621+
* If this function is never called then a device defaults to being powered.
622+
*/
623+
void drm_dp_dpcd_set_powered(struct drm_dp_aux *aux, bool powered)
624+
{
625+
if (!aux)
626+
return;
627+
628+
mutex_lock(&aux->hw_mutex);
629+
aux->powered_down = !powered;
630+
mutex_unlock(&aux->hw_mutex);
631+
}
632+
EXPORT_SYMBOL(drm_dp_dpcd_set_powered);
633+
602634
/**
603635
* drm_dp_dpcd_read() - read a series of bytes from the DPCD
604636
* @aux: DisplayPort AUX channel (SST or MST)
@@ -1858,6 +1890,9 @@ static int drm_dp_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
18581890
struct drm_dp_aux_msg msg;
18591891
int err = 0;
18601892

1893+
if (aux->powered_down)
1894+
return -EBUSY;
1895+
18611896
dp_aux_i2c_transfer_size = clamp(dp_aux_i2c_transfer_size, 1, DP_AUX_MAX_PAYLOAD_BYTES);
18621897

18631898
memset(&msg, 0, sizeof(msg));
@@ -2913,6 +2948,103 @@ void drm_dp_vsc_sdp_log(struct drm_printer *p, const struct drm_dp_vsc_sdp *vsc)
29132948
}
29142949
EXPORT_SYMBOL(drm_dp_vsc_sdp_log);
29152950

2951+
/**
2952+
* drm_dp_vsc_sdp_supported() - check if vsc sdp is supported
2953+
* @aux: DisplayPort AUX channel
2954+
* @dpcd: DisplayPort configuration data
2955+
*
2956+
* Returns true if vsc sdp is supported, else returns false
2957+
*/
2958+
bool drm_dp_vsc_sdp_supported(struct drm_dp_aux *aux, const u8 dpcd[DP_RECEIVER_CAP_SIZE])
2959+
{
2960+
u8 rx_feature;
2961+
2962+
if (dpcd[DP_DPCD_REV] < DP_DPCD_REV_13)
2963+
return false;
2964+
2965+
if (drm_dp_dpcd_readb(aux, DP_DPRX_FEATURE_ENUMERATION_LIST, &rx_feature) != 1) {
2966+
drm_dbg_dp(aux->drm_dev, "failed to read DP_DPRX_FEATURE_ENUMERATION_LIST\n");
2967+
return false;
2968+
}
2969+
2970+
return (rx_feature & DP_VSC_SDP_EXT_FOR_COLORIMETRY_SUPPORTED);
2971+
}
2972+
EXPORT_SYMBOL(drm_dp_vsc_sdp_supported);
2973+
2974+
/**
2975+
* drm_dp_vsc_sdp_pack() - pack a given vsc sdp into generic dp_sdp
2976+
* @vsc: vsc sdp initialized according to its purpose as defined in
2977+
* table 2-118 - table 2-120 in DP 1.4a specification
2978+
* @sdp: valid handle to the generic dp_sdp which will be packed
2979+
*
2980+
* Returns length of sdp on success and error code on failure
2981+
*/
2982+
ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc,
2983+
struct dp_sdp *sdp)
2984+
{
2985+
size_t length = sizeof(struct dp_sdp);
2986+
2987+
memset(sdp, 0, sizeof(struct dp_sdp));
2988+
2989+
/*
2990+
* Prepare VSC Header for SU as per DP 1.4a spec, Table 2-119
2991+
* VSC SDP Header Bytes
2992+
*/
2993+
sdp->sdp_header.HB0 = 0; /* Secondary-Data Packet ID = 0 */
2994+
sdp->sdp_header.HB1 = vsc->sdp_type; /* Secondary-data Packet Type */
2995+
sdp->sdp_header.HB2 = vsc->revision; /* Revision Number */
2996+
sdp->sdp_header.HB3 = vsc->length; /* Number of Valid Data Bytes */
2997+
2998+
if (vsc->revision == 0x6) {
2999+
sdp->db[0] = 1;
3000+
sdp->db[3] = 1;
3001+
}
3002+
3003+
/*
3004+
* Revision 0x5 and revision 0x7 supports Pixel Encoding/Colorimetry
3005+
* Format as per DP 1.4a spec and DP 2.0 respectively.
3006+
*/
3007+
if (!(vsc->revision == 0x5 || vsc->revision == 0x7))
3008+
goto out;
3009+
3010+
/* VSC SDP Payload for DB16 through DB18 */
3011+
/* Pixel Encoding and Colorimetry Formats */
3012+
sdp->db[16] = (vsc->pixelformat & 0xf) << 4; /* DB16[7:4] */
3013+
sdp->db[16] |= vsc->colorimetry & 0xf; /* DB16[3:0] */
3014+
3015+
switch (vsc->bpc) {
3016+
case 6:
3017+
/* 6bpc: 0x0 */
3018+
break;
3019+
case 8:
3020+
sdp->db[17] = 0x1; /* DB17[3:0] */
3021+
break;
3022+
case 10:
3023+
sdp->db[17] = 0x2;
3024+
break;
3025+
case 12:
3026+
sdp->db[17] = 0x3;
3027+
break;
3028+
case 16:
3029+
sdp->db[17] = 0x4;
3030+
break;
3031+
default:
3032+
WARN(1, "Missing case %d\n", vsc->bpc);
3033+
return -EINVAL;
3034+
}
3035+
3036+
/* Dynamic Range and Component Bit Depth */
3037+
if (vsc->dynamic_range == DP_DYNAMIC_RANGE_CTA)
3038+
sdp->db[17] |= 0x80; /* DB17[7] */
3039+
3040+
/* Content Type */
3041+
sdp->db[18] = vsc->content_type & 0x7;
3042+
3043+
out:
3044+
return length;
3045+
}
3046+
EXPORT_SYMBOL(drm_dp_vsc_sdp_pack);
3047+
29163048
/**
29173049
* drm_dp_get_pcon_max_frl_bw() - maximum frl supported by PCON
29183050
* @dpcd: DisplayPort configuration data

drivers/gpu/drm/drm_crtc.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,6 @@ int drm_crtc_force_disable(struct drm_crtc *crtc)
107107
return drm_mode_set_config_internal(&set);
108108
}
109109

110-
static unsigned int drm_num_crtcs(struct drm_device *dev)
111-
{
112-
unsigned int num = 0;
113-
struct drm_crtc *tmp;
114-
115-
drm_for_each_crtc(tmp, dev) {
116-
num++;
117-
}
118-
119-
return num;
120-
}
121-
122110
int drm_crtc_register_all(struct drm_device *dev)
123111
{
124112
struct drm_crtc *crtc;
@@ -278,8 +266,7 @@ static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *
278266
if (name) {
279267
crtc->name = kvasprintf(GFP_KERNEL, name, ap);
280268
} else {
281-
crtc->name = kasprintf(GFP_KERNEL, "crtc-%d",
282-
drm_num_crtcs(dev));
269+
crtc->name = kasprintf(GFP_KERNEL, "crtc-%d", config->num_crtc);
283270
}
284271
if (!crtc->name) {
285272
drm_mode_object_unregister(dev, &crtc->base);

0 commit comments

Comments
 (0)