aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm
diff options
context:
space:
mode:
authorAbhinav Kumar <abhinavk@codeaurora.org>2020-09-12 14:08:15 -0700
committerRob Clark <robdclark@chromium.org>2020-09-15 10:54:35 -0700
commitab205927592be25ddef5db10344925b389fd4344 (patch)
treeec0ec7846015744ec28ff566dae77662d090b269 /drivers/gpu/drm/msm
parentdrm/msm/dp: add debugfs nodes for video pattern tests (diff)
downloadlinux-dev-ab205927592be25ddef5db10344925b389fd4344.tar.xz
linux-dev-ab205927592be25ddef5db10344925b389fd4344.zip
drm/msm/dp: remove mode hard-coding in case of DP CTS
No need to fix the number of resolutions to one during the video pattern CTS test. The userspace test client will handle both the hotplug as well as picking the right resolution for the test. Changes in v2: rebase on top of latest patchset of dependency Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org> Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r--drivers/gpu/drm/msm/dp/dp_display.c3
-rw-r--r--drivers/gpu/drm/msm/dp/dp_link.c2
-rw-r--r--drivers/gpu/drm/msm/dp/dp_panel.c50
3 files changed, 2 insertions, 53 deletions
diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index aa7661f2a441..94b05e4a2574 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -426,10 +426,7 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev)
static void dp_display_handle_video_request(struct dp_display_private *dp)
{
if (dp->link->sink_request & DP_TEST_LINK_VIDEO_PATTERN) {
- /* force disconnect followed by connect */
- dp->usbpd->connect(dp->usbpd, false);
dp->panel->video_test = true;
- dp->usbpd->connect(dp->usbpd, true);
dp_link_send_test_response(dp->link);
}
}
diff --git a/drivers/gpu/drm/msm/dp/dp_link.c b/drivers/gpu/drm/msm/dp/dp_link.c
index 3cbae92deff0..ac0e1daea913 100644
--- a/drivers/gpu/drm/msm/dp/dp_link.c
+++ b/drivers/gpu/drm/msm/dp/dp_link.c
@@ -1059,8 +1059,8 @@ int dp_link_process_request(struct dp_link *dp_link)
}
if (dp_link_is_video_pattern_requested(link)) {
+ ret = 0;
dp_link->sink_request |= DP_TEST_LINK_VIDEO_PATTERN;
- return -EINVAL;
}
if (dp_link_is_audio_pattern_requested(link)) {
diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
index 7cdf37c525d8..4e5af59db6ba 100644
--- a/drivers/gpu/drm/msm/dp/dp_panel.c
+++ b/drivers/gpu/drm/msm/dp/dp_panel.c
@@ -128,46 +128,6 @@ static u32 dp_panel_get_supported_bpp(struct dp_panel *dp_panel,
return bpp;
}
-static void dp_panel_set_test_mode(struct dp_panel_private *panel,
- struct dp_display_mode *mode)
-{
- struct drm_display_mode *drm_mode = NULL;
- struct dp_link_test_video *test_info = NULL;
-
- drm_mode = &mode->drm_mode;
- test_info = &panel->link->test_video;
-
- drm_mode->hdisplay = test_info->test_h_width;
- drm_mode->hsync_start = drm_mode->hdisplay + test_info->test_h_total -
- (test_info->test_h_start + test_info->test_h_width);
- drm_mode->hsync_end = drm_mode->hsync_start +
- test_info->test_hsync_width;
- drm_mode->htotal = drm_mode->hsync_end + test_info->test_h_start -
- test_info->test_hsync_width;
-
- drm_mode->vdisplay = test_info->test_v_height;
- drm_mode->vsync_start = drm_mode->vdisplay + test_info->test_v_total -
- (test_info->test_v_start + test_info->test_v_height);
- drm_mode->vsync_end = drm_mode->vsync_start +
- test_info->test_vsync_width;
- drm_mode->vtotal = drm_mode->vsync_end + test_info->test_v_start -
- test_info->test_vsync_width;
-
- drm_mode->clock = test_info->test_h_total *
- test_info->test_v_total * test_info->test_rr_n;
-
- drm_mode->type = 0x48;
- drm_mode_set_name(drm_mode);
-
- if (test_info->test_rr_d == 0)
- drm_mode->clock /= 1000;
- else
- drm_mode->clock /= 1001;
-
- if (test_info->test_h_width == 640)
- drm_mode->clock = 25170;
-}
-
static int dp_panel_update_modes(struct drm_connector *connector,
struct edid *edid)
{
@@ -285,21 +245,13 @@ u32 dp_panel_get_mode_bpp(struct dp_panel *dp_panel,
int dp_panel_get_modes(struct dp_panel *dp_panel,
struct drm_connector *connector, struct dp_display_mode *mode)
{
- struct dp_panel_private *panel;
-
if (!dp_panel) {
DRM_ERROR("invalid input\n");
return -EINVAL;
}
- panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
-
- if (dp_panel->video_test) {
- dp_panel_set_test_mode(panel, mode);
- return 1;
- } else if (dp_panel->edid) {
+ if (dp_panel->edid)
return dp_panel_update_modes(connector, dp_panel->edid);
- }
return 0;
}