monitor: Move tiled CRTC mode identification into helper

It'll be used in more places later.

https://bugzilla.gnome.org/show_bug.cgi?id=781723
This commit is contained in:
Jonas Ådahl 2017-04-28 15:36:51 +08:00
parent 7303a78b06
commit cd775929bf

View File

@ -604,6 +604,14 @@ is_monitor_mode_assigned (MetaMonitor *monitor,
return TRUE; return TRUE;
} }
static gboolean
is_crtc_mode_tiled (MetaOutput *output,
MetaCrtcMode *crtc_mode)
{
return (crtc_mode->width == (int) output->tile_info.tile_w &&
crtc_mode->height == (int) output->tile_info.tile_h);
}
static MetaMonitorMode * static MetaMonitorMode *
create_tiled_monitor_mode (MetaMonitorTiled *monitor_tiled) create_tiled_monitor_mode (MetaMonitorTiled *monitor_tiled)
{ {
@ -653,12 +661,7 @@ create_untiled_monitor_mode (MetaMonitorTiled *monitor_tiled,
GList *l; GList *l;
int i; int i;
/* if (is_crtc_mode_tiled (main_output, crtc_mode))
* Assume modes with a resolution identical to the tile sizes are tiled
* modes.
*/
if (crtc_mode->width == (int) main_output->tile_info.tile_w &&
crtc_mode->height == (int) main_output->tile_info.tile_h)
return NULL; return NULL;
mode = g_new0 (MetaMonitorModeTiled, 1); mode = g_new0 (MetaMonitorModeTiled, 1);