mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-10 07:00:17 +01:00
xwayland: Use our CVT function for fixed mode as well
Now that our CVT function is able to deal with non-standard modes, we
can safely use it for the fixed mode as well.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
(cherry picked from commit eb20ba039a)
This commit is contained in:
parent
9d2cc63a9a
commit
dfaf3af994
1 changed files with 4 additions and 17 deletions
|
|
@ -1086,11 +1086,8 @@ xwl_randr_add_modes_fixed(struct xwl_output *xwl_output,
|
|||
{
|
||||
RRModePtr *modes = NULL;
|
||||
RRModePtr mode;
|
||||
xRRModeInfo mode_info = { 0, };
|
||||
char mode_name[128];
|
||||
int i, nmodes, current;
|
||||
|
||||
|
||||
modes = xallocarray(ARRAY_SIZE(xwl_output_fake_modes) + 1, sizeof(RRModePtr));
|
||||
if (!modes) {
|
||||
ErrorF("Failed to allocated RandR modes\n");
|
||||
|
|
@ -1115,21 +1112,11 @@ xwl_randr_add_modes_fixed(struct xwl_output *xwl_output,
|
|||
}
|
||||
|
||||
if (!current) {
|
||||
/* Add the current mode as it's not part of the fake modes.
|
||||
* Not using libcvt as the size is set from the command line and
|
||||
* may not be a valid CVT mode.
|
||||
*/
|
||||
mode_info.width = current_width;
|
||||
mode_info.height = current_height;
|
||||
mode_info.hTotal = current_width;
|
||||
mode_info.vTotal = current_height;
|
||||
mode_info.dotClock = 60 * 1000 * 1000;
|
||||
/* Add the current mode as it's not part of the fake modes. */
|
||||
mode = xwayland_cvt(current_width, current_height, 60, 0, 0);
|
||||
|
||||
snprintf(mode_name, sizeof(mode_name), "%dx%d",
|
||||
current_width, current_height);
|
||||
mode_info.nameLength = strlen(mode_name);
|
||||
|
||||
modes[nmodes++] = RRModeGet(&mode_info, mode_name);
|
||||
if (mode)
|
||||
modes[nmodes++] = mode;
|
||||
}
|
||||
|
||||
qsort(modes, nmodes, sizeof(RRModePtr), mode_sort);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue