From 6fcc7b2660c483699b8be04f50da6e5cc423f54c Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 27 Mar 2023 03:57:03 +0000 Subject: [PATCH] drm/amd/display: fix mapping to non-allocated address From Brandon Syu 8ce8a443ddd9002861a4ee8a7e33a0c02717422f in linux-6.1.y/6.1.16 9190d4a263264eabf715f5fc1827da45e3fdc247 in mainline linux --- .../pci/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c | 6 ++++-- .../pci/drm/amd/display/dc/gpio/dcn30/hw_factory_dcn30.c | 6 ++++-- .../pci/drm/amd/display/dc/gpio/dcn32/hw_factory_dcn32.c | 6 ++++-- sys/dev/pci/drm/amd/display/dc/gpio/ddc_regs.h | 7 +++++++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/sys/dev/pci/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c b/sys/dev/pci/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c index 9b63c6c0cc8..e0bd0c722e0 100644 --- a/sys/dev/pci/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c +++ b/sys/dev/pci/drm/amd/display/dc/gpio/dcn20/hw_factory_dcn20.c @@ -138,7 +138,8 @@ static const struct ddc_sh_mask ddc_shift[] = { DDC_MASK_SH_LIST_DCN2(__SHIFT, 3), DDC_MASK_SH_LIST_DCN2(__SHIFT, 4), DDC_MASK_SH_LIST_DCN2(__SHIFT, 5), - DDC_MASK_SH_LIST_DCN2(__SHIFT, 6) + DDC_MASK_SH_LIST_DCN2(__SHIFT, 6), + DDC_MASK_SH_LIST_DCN2_VGA(__SHIFT) }; static const struct ddc_sh_mask ddc_mask[] = { @@ -147,7 +148,8 @@ static const struct ddc_sh_mask ddc_mask[] = { DDC_MASK_SH_LIST_DCN2(_MASK, 3), DDC_MASK_SH_LIST_DCN2(_MASK, 4), DDC_MASK_SH_LIST_DCN2(_MASK, 5), - DDC_MASK_SH_LIST_DCN2(_MASK, 6) + DDC_MASK_SH_LIST_DCN2(_MASK, 6), + DDC_MASK_SH_LIST_DCN2_VGA(_MASK) }; #include "../generic_regs.h" diff --git a/sys/dev/pci/drm/amd/display/dc/gpio/dcn30/hw_factory_dcn30.c b/sys/dev/pci/drm/amd/display/dc/gpio/dcn30/hw_factory_dcn30.c index 6c4f75c234e..fd0c6e012ed 100644 --- a/sys/dev/pci/drm/amd/display/dc/gpio/dcn30/hw_factory_dcn30.c +++ b/sys/dev/pci/drm/amd/display/dc/gpio/dcn30/hw_factory_dcn30.c @@ -147,7 +147,8 @@ static const struct ddc_sh_mask ddc_shift[] = { DDC_MASK_SH_LIST_DCN2(__SHIFT, 3), DDC_MASK_SH_LIST_DCN2(__SHIFT, 4), DDC_MASK_SH_LIST_DCN2(__SHIFT, 5), - DDC_MASK_SH_LIST_DCN2(__SHIFT, 6) + DDC_MASK_SH_LIST_DCN2(__SHIFT, 6), + DDC_MASK_SH_LIST_DCN2_VGA(__SHIFT) }; static const struct ddc_sh_mask ddc_mask[] = { @@ -156,7 +157,8 @@ static const struct ddc_sh_mask ddc_mask[] = { DDC_MASK_SH_LIST_DCN2(_MASK, 3), DDC_MASK_SH_LIST_DCN2(_MASK, 4), DDC_MASK_SH_LIST_DCN2(_MASK, 5), - DDC_MASK_SH_LIST_DCN2(_MASK, 6) + DDC_MASK_SH_LIST_DCN2(_MASK, 6), + DDC_MASK_SH_LIST_DCN2_VGA(_MASK) }; #include "../generic_regs.h" diff --git a/sys/dev/pci/drm/amd/display/dc/gpio/dcn32/hw_factory_dcn32.c b/sys/dev/pci/drm/amd/display/dc/gpio/dcn32/hw_factory_dcn32.c index 0ea52ba5ac8..9f6872ae402 100644 --- a/sys/dev/pci/drm/amd/display/dc/gpio/dcn32/hw_factory_dcn32.c +++ b/sys/dev/pci/drm/amd/display/dc/gpio/dcn32/hw_factory_dcn32.c @@ -149,7 +149,8 @@ static const struct ddc_sh_mask ddc_shift[] = { DDC_MASK_SH_LIST_DCN2(__SHIFT, 3), DDC_MASK_SH_LIST_DCN2(__SHIFT, 4), DDC_MASK_SH_LIST_DCN2(__SHIFT, 5), - DDC_MASK_SH_LIST_DCN2(__SHIFT, 6) + DDC_MASK_SH_LIST_DCN2(__SHIFT, 6), + DDC_MASK_SH_LIST_DCN2_VGA(__SHIFT) }; static const struct ddc_sh_mask ddc_mask[] = { @@ -158,7 +159,8 @@ static const struct ddc_sh_mask ddc_mask[] = { DDC_MASK_SH_LIST_DCN2(_MASK, 3), DDC_MASK_SH_LIST_DCN2(_MASK, 4), DDC_MASK_SH_LIST_DCN2(_MASK, 5), - DDC_MASK_SH_LIST_DCN2(_MASK, 6) + DDC_MASK_SH_LIST_DCN2(_MASK, 6), + DDC_MASK_SH_LIST_DCN2_VGA(_MASK) }; #include "../generic_regs.h" diff --git a/sys/dev/pci/drm/amd/display/dc/gpio/ddc_regs.h b/sys/dev/pci/drm/amd/display/dc/gpio/ddc_regs.h index 308a543178a..59884ef651b 100644 --- a/sys/dev/pci/drm/amd/display/dc/gpio/ddc_regs.h +++ b/sys/dev/pci/drm/amd/display/dc/gpio/ddc_regs.h @@ -113,6 +113,13 @@ (PHY_AUX_CNTL__AUX## cd ##_PAD_RXSEL## mask_sh),\ (DC_GPIO_AUX_CTRL_5__DDC_PAD## cd ##_I2CMODE## mask_sh)} +#define DDC_MASK_SH_LIST_DCN2_VGA(mask_sh) \ + {DDC_MASK_SH_LIST_COMMON(mask_sh),\ + 0,\ + 0,\ + 0,\ + 0} + struct ddc_registers { struct gpio_registers gpio; uint32_t ddc_setup; -- 2.20.1