summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
diff options
context:
space:
mode:
authorAlex Hung <alex.hung@amd.com>2023-12-01 06:25:24 -0700
committerAlex Deucher <alexander.deucher@amd.com>2023-12-06 15:22:34 -0500
commitdfc03588cf8ce2af8ef810cd226dc98ee4fbac38 (patch)
tree4dc12079bb1f50318b84a99dfcdd8c20caf87e8b /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
parent198891fd2902fba155fe23f8ad27c9cf8cd8286d (diff)
downloadlinux-dfc03588cf8ce2af8ef810cd226dc98ee4fbac38.tar.gz
linux-dfc03588cf8ce2af8ef810cd226dc98ee4fbac38.tar.bz2
linux-dfc03588cf8ce2af8ef810cd226dc98ee4fbac38.zip
drm/amd/display: Initialize writeback connector
[WHAT] Create a drm_writeback_connector when connector signal equals SIGNAL_TYPE_VIRTUAL. Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 9b791e3f7e33..51a873658535 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -54,6 +54,7 @@
#include "amdgpu_dm_crtc.h"
#include "amdgpu_dm_hdcp.h"
#include <drm/display/drm_hdcp_helper.h>
+#include "amdgpu_dm_wb.h"
#include "amdgpu_pm.h"
#include "amdgpu_atombios.h"
@@ -4471,8 +4472,25 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
link = dc_get_link_at_index(dm->dc, i);
- if (link->connector_signal == SIGNAL_TYPE_VIRTUAL)
+ if (link->connector_signal == SIGNAL_TYPE_VIRTUAL) {
+ struct drm_writeback_connector *wbcon = kzalloc(sizeof(*wbcon), GFP_KERNEL);
+
+ if (!wbcon) {
+ DRM_ERROR("KMS: Failed to allocate writeback connector\n");
+ continue;
+ }
+
+ if (amdgpu_dm_wb_connector_init(dm, wbcon)) {
+ DRM_ERROR("KMS: Failed to initialize writeback connector\n");
+ kfree(wbcon);
+ continue;
+ }
+
+ link->psr_settings.psr_feature_enabled = false;
+ link->psr_settings.psr_version = DC_PSR_VERSION_UNSUPPORTED;
+
continue;
+ }
aconnector = kzalloc(sizeof(*aconnector), GFP_KERNEL);
if (!aconnector)