Skip to content

Commit

Permalink
Merge pull request #13 from rossphilipson/xres_1366_misery
Browse files Browse the repository at this point in the history
Round down resolutions that are not divisible by 8.
  • Loading branch information
jean-edouard authored Jul 6, 2016
2 parents 7f81962 + ea0fd67 commit d89c564
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion surfman/src/ioemugfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ ioemugfx_display_get_info(void *priv,
struct ioemugfx_device *dev = priv;
struct monitor *m;
int align;
uint16_t rounded_xres;

surfman_info ("DisplayID:%d", msg->DisplayID);

Expand All @@ -117,7 +118,17 @@ ioemugfx_display_get_info(void *priv,
out->max_xres = m->info->i.prefered_mode->htimings[0];
out->max_yres = m->info->i.prefered_mode->vtimings[0];

surfman_info ("Monitor %d: Max resolution: %dx%d, stride alignment:%d",
/* Checking for resolutions that are not divisible by 8 and rounding them
* down. See the comment in plugins/drm/src/device-intel.c!should_avoid_scaling()
*/
rounded_xres = out->max_xres & ~0x7;
if (rounded_xres != out->max_xres) {
surfman_info ("Monitor %d: Rounding down xres: %d -> %d",
msg->DisplayID, out->max_xres, rounded_xres);
out->max_xres = rounded_xres;
}

surfman_info ("Monitor %d: Max resolution: %dx%d, stride alignment: %d",
msg->DisplayID, out->max_xres, out->max_yres, out->align);

return 0;
Expand Down

0 comments on commit d89c564

Please sign in to comment.