aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2015-03-11 10:23:14 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-11 17:10:11 -0400
commit0e3704c94c5737f42e9ac49a5dcca366674e5229 (patch)
tree4bd36ef8686ddb7f59675fe57b4fdd72216fac11
parent675c8328db6548f00a4e60770e66ab53752d6bf2 (diff)
drm/fb: handle tiled connectors better
We don't want tile 0,0 to artificially constrain the size of the legacy fbdev device. Instead when reducing fb_size to be the minimum of all displays, only consider the rightmost and bottommost tiles. Signed-off-by: Rob Clark <robdclark@gmail.com> Tested-by: Hai Li <hali@codeaurora.org> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index dca98a40a550..1a20db7c971f 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1034,9 +1034,16 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
1034 crtc_count = 0; 1034 crtc_count = 0;
1035 for (i = 0; i < fb_helper->crtc_count; i++) { 1035 for (i = 0; i < fb_helper->crtc_count; i++) {
1036 struct drm_display_mode *desired_mode; 1036 struct drm_display_mode *desired_mode;
1037 int x, y; 1037 struct drm_mode_set *mode_set;
1038 int x, y, j;
1039 /* in case of tile group, are we the last tile vert or horiz?
1040 * If no tile group you are always the last one both vertically
1041 * and horizontally
1042 */
1043 bool lastv = true, lasth = true;
1038 1044
1039 desired_mode = fb_helper->crtc_info[i].desired_mode; 1045 desired_mode = fb_helper->crtc_info[i].desired_mode;
1046 mode_set = &fb_helper->crtc_info[i].mode_set;
1040 1047
1041 if (!desired_mode) 1048 if (!desired_mode)
1042 continue; 1049 continue;
@@ -1051,8 +1058,21 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
1051 1058
1052 sizes.surface_width = max_t(u32, desired_mode->hdisplay + x, sizes.surface_width); 1059 sizes.surface_width = max_t(u32, desired_mode->hdisplay + x, sizes.surface_width);
1053 sizes.surface_height = max_t(u32, desired_mode->vdisplay + y, sizes.surface_height); 1060 sizes.surface_height = max_t(u32, desired_mode->vdisplay + y, sizes.surface_height);
1054 sizes.fb_width = min_t(u32, desired_mode->hdisplay + x, sizes.fb_width); 1061
1055 sizes.fb_height = min_t(u32, desired_mode->vdisplay + y, sizes.fb_height); 1062 for (j = 0; j < mode_set->num_connectors; j++) {
1063 struct drm_connector *connector = mode_set->connectors[j];
1064 if (connector->has_tile) {
1065 lasth = (connector->tile_h_loc == (connector->num_h_tile - 1));
1066 lastv = (connector->tile_v_loc == (connector->num_v_tile - 1));
1067 /* cloning to multiple tiles is just crazy-talk, so: */
1068 break;
1069 }
1070 }
1071
1072 if (lasth)
1073 sizes.fb_width = min_t(u32, desired_mode->hdisplay + x, sizes.fb_width);
1074 if (lastv)
1075 sizes.fb_height = min_t(u32, desired_mode->vdisplay + y, sizes.fb_height);
1056 } 1076 }
1057 1077
1058 if (crtc_count == 0 || sizes.fb_width == -1 || sizes.fb_height == -1) { 1078 if (crtc_count == 0 || sizes.fb_width == -1 || sizes.fb_height == -1) {