Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Abhinav Kumar and committed by
Rob Clark
ab205927 de3ee254

+2 -53
-3
drivers/gpu/drm/msm/dp/dp_display.c
··· 426 426 static void dp_display_handle_video_request(struct dp_display_private *dp) 427 427 { 428 428 if (dp->link->sink_request & DP_TEST_LINK_VIDEO_PATTERN) { 429 - /* force disconnect followed by connect */ 430 - dp->usbpd->connect(dp->usbpd, false); 431 429 dp->panel->video_test = true; 432 - dp->usbpd->connect(dp->usbpd, true); 433 430 dp_link_send_test_response(dp->link); 434 431 } 435 432 }
+1 -1
drivers/gpu/drm/msm/dp/dp_link.c
··· 1059 1059 } 1060 1060 1061 1061 if (dp_link_is_video_pattern_requested(link)) { 1062 + ret = 0; 1062 1063 dp_link->sink_request |= DP_TEST_LINK_VIDEO_PATTERN; 1063 - return -EINVAL; 1064 1064 } 1065 1065 1066 1066 if (dp_link_is_audio_pattern_requested(link)) {
+1 -49
drivers/gpu/drm/msm/dp/dp_panel.c
··· 128 128 return bpp; 129 129 } 130 130 131 - static void dp_panel_set_test_mode(struct dp_panel_private *panel, 132 - struct dp_display_mode *mode) 133 - { 134 - struct drm_display_mode *drm_mode = NULL; 135 - struct dp_link_test_video *test_info = NULL; 136 - 137 - drm_mode = &mode->drm_mode; 138 - test_info = &panel->link->test_video; 139 - 140 - drm_mode->hdisplay = test_info->test_h_width; 141 - drm_mode->hsync_start = drm_mode->hdisplay + test_info->test_h_total - 142 - (test_info->test_h_start + test_info->test_h_width); 143 - drm_mode->hsync_end = drm_mode->hsync_start + 144 - test_info->test_hsync_width; 145 - drm_mode->htotal = drm_mode->hsync_end + test_info->test_h_start - 146 - test_info->test_hsync_width; 147 - 148 - drm_mode->vdisplay = test_info->test_v_height; 149 - drm_mode->vsync_start = drm_mode->vdisplay + test_info->test_v_total - 150 - (test_info->test_v_start + test_info->test_v_height); 151 - drm_mode->vsync_end = drm_mode->vsync_start + 152 - test_info->test_vsync_width; 153 - drm_mode->vtotal = drm_mode->vsync_end + test_info->test_v_start - 154 - test_info->test_vsync_width; 155 - 156 - drm_mode->clock = test_info->test_h_total * 157 - test_info->test_v_total * test_info->test_rr_n; 158 - 159 - drm_mode->type = 0x48; 160 - drm_mode_set_name(drm_mode); 161 - 162 - if (test_info->test_rr_d == 0) 163 - drm_mode->clock /= 1000; 164 - else 165 - drm_mode->clock /= 1001; 166 - 167 - if (test_info->test_h_width == 640) 168 - drm_mode->clock = 25170; 169 - } 170 - 171 131 static int dp_panel_update_modes(struct drm_connector *connector, 172 132 struct edid *edid) 173 133 { ··· 245 285 int dp_panel_get_modes(struct dp_panel *dp_panel, 246 286 struct drm_connector *connector, struct dp_display_mode *mode) 247 287 { 248 - struct dp_panel_private *panel; 249 - 250 288 if (!dp_panel) { 251 289 DRM_ERROR("invalid input\n"); 252 290 return -EINVAL; 253 291 } 254 292 255 - panel = container_of(dp_panel, struct dp_panel_private, dp_panel); 256 - 257 - if (dp_panel->video_test) { 258 - dp_panel_set_test_mode(panel, mode); 259 - return 1; 260 - } else if (dp_panel->edid) { 293 + if (dp_panel->edid) 261 294 return dp_panel_update_modes(connector, dp_panel->edid); 262 - } 263 295 264 296 return 0; 265 297 }