Fix csync detailed mode parsing

pull/1/head changed/i9/kernel-lt-6.1.63-2.el9.inferit
Arkady L. Shane 1 year ago
parent 63d5b5b08a
commit 4033f710b7
Signed by: tigro
GPG Key ID: 9C7900103E1C4F8B

@ -0,0 +1,80 @@
From 51f81a659c7abff2e17ba7b6a30f729c8f16d32f Mon Sep 17 00:00:00 2001
From: tigro <arkadiy.sheyn@softline.com>
Date: Tue, 5 Dec 2023 00:15:42 +0300
Subject: [PATCH] Fix csync detailed mode parsing
---
drivers/gpu/drm/drm_edid.c | 26 +++++++++++++++++++-------
include/drm/drm_edid.h | 12 +++++++++---
2 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 5ed77e336..a26c6c57a 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3307,9 +3307,6 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
DRM_DEBUG_KMS("stereo mode not supported\n");
return NULL;
}
- if (!(pt->misc & DRM_EDID_PT_SEPARATE_SYNC)) {
- DRM_DEBUG_KMS("composite sync not supported\n");
- }
/* it is incorrect if hsync/vsync width is zero */
if (!hsync_pulse_width || !vsync_pulse_width) {
@@ -3356,10 +3353,25 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
if (quirks & EDID_QUIRK_DETAILED_SYNC_PP) {
mode->flags |= DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC;
} else {
- mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ?
- DRM_MODE_FLAG_PHSYNC : DRM_MODE_FLAG_NHSYNC;
- mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ?
- DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC;
+ switch (pt->misc & DRM_EDID_PT_SYNC_MASK) {
+ case DRM_EDID_PT_ANALOG_CSYNC:
+ case DRM_EDID_PT_BIPOLAR_ANALOG_CSYNC:
+ drm_dbg_kms(dev, "Analog composite sync!\n");
+ mode->flags |= DRM_MODE_FLAG_CSYNC | DRM_MODE_FLAG_NCSYNC;
+ break;
+ case DRM_EDID_PT_DIGITAL_CSYNC:
+ drm_dbg_kms(dev, "Digital composite sync!\n");
+ mode->flags |= DRM_MODE_FLAG_CSYNC;
+ mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ?
+ DRM_MODE_FLAG_PCSYNC : DRM_MODE_FLAG_NCSYNC;
+ break;
+ case DRM_EDID_PT_DIGITAL_SEPARATE_SYNC:
+ mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ?
+ DRM_MODE_FLAG_PHSYNC : DRM_MODE_FLAG_NHSYNC;
+ mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ?
+ DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC;
+ break;
+ }
}
set_size:
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 1ed61e2b3..008d2ed39 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -61,9 +61,15 @@ struct std_timing {
u8 vfreq_aspect;
} __attribute__((packed));
-#define DRM_EDID_PT_HSYNC_POSITIVE (1 << 1)
-#define DRM_EDID_PT_VSYNC_POSITIVE (1 << 2)
-#define DRM_EDID_PT_SEPARATE_SYNC (3 << 3)
+#define DRM_EDID_PT_SYNC_MASK (3 << 3)
+# define DRM_EDID_PT_ANALOG_CSYNC (0 << 3)
+# define DRM_EDID_PT_BIPOLAR_ANALOG_CSYNC (1 << 3)
+# define DRM_EDID_PT_DIGITAL_CSYNC (2 << 3)
+# define DRM_EDID_PT_CSYNC_ON_RGB (1 << 1) /* analog csync only */
+# define DRM_EDID_PT_CSYNC_SERRATE (1 << 2)
+# define DRM_EDID_PT_DIGITAL_SEPARATE_SYNC (3 << 3)
+# define DRM_EDID_PT_HSYNC_POSITIVE (1 << 1) /* also digital csync */
+# define DRM_EDID_PT_VSYNC_POSITIVE (1 << 2)
#define DRM_EDID_PT_STEREO (1 << 5)
#define DRM_EDID_PT_INTERLACED (1 << 7)
--
2.43.0

@ -38,7 +38,7 @@
%endif %endif
# Set pkg_release. # Set pkg_release.
%global pkg_release 1%{?buildid}%{?dist}.inferit %global pkg_release 2%{?buildid}%{?dist}.inferit
# Architectures upon which we can sign the kernel # Architectures upon which we can sign the kernel
# for secure boot authentication. # for secure boot authentication.
@ -242,6 +242,8 @@ Source2000: cpupower.service
Source2001: cpupower.config Source2001: cpupower.config
Source2002: kvm_stat.logrotate Source2002: kvm_stat.logrotate
Patch0: 0001-Fix-csync-detailed-mode-parsing.patch
%if %{signkernel} %if %{signkernel}
%define secureboot_ca_0 %{_datadir}/pki/sb-certs/secureboot-ca-%{_arch}.cer %define secureboot_ca_0 %{_datadir}/pki/sb-certs/secureboot-ca-%{_arch}.cer
%define secureboot_key_0 %{_datadir}/pki/sb-certs/secureboot-kernel-%{_arch}.cer %define secureboot_key_0 %{_datadir}/pki/sb-certs/secureboot-kernel-%{_arch}.cer
@ -538,6 +540,7 @@ exit 1
mv linux-%{LKAver} linux-%{KVERREL} mv linux-%{LKAver} linux-%{KVERREL}
pushd linux-%{KVERREL} > /dev/null pushd linux-%{KVERREL} > /dev/null
%patch0 -p1
# Purge the source tree of all unrequired dot-files. # Purge the source tree of all unrequired dot-files.
find . -name '.*' -type f -delete find . -name '.*' -type f -delete
@ -1482,6 +1485,9 @@ fi
%kernel_lt_variant_files %{_use_vdso} %{with_std} %kernel_lt_variant_files %{_use_vdso} %{with_std}
%changelog %changelog
* Tue Dec 5 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 6.1.63-2.inferit
- Fix csync detailed mode parsing
* Sat Nov 25 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 6.1.63-1.inferit * Sat Nov 25 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 6.1.63-1.inferit
- Update to 6.1.63 - Update to 6.1.63

Loading…
Cancel
Save