Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3069876imu; Fri, 18 Jan 2019 04:22:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN6HaBPY5kXL53Sn/zC1fFzWBLG4tBd5TRbzB/JMm9MBnViUI6t5p8TpfDoUW4yk3Sw5/PLQ X-Received: by 2002:a63:a064:: with SMTP id u36mr17554909pgn.145.1547814138799; Fri, 18 Jan 2019 04:22:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547814138; cv=none; d=google.com; s=arc-20160816; b=DbdhcnM94uysbfbzAkY9T2ig2VlrzZwJknANhYq6JtioGZYradIaivQ+l6Xen2NTv0 BM+9++rZQj69jrG8zFITV+XmqG6cAS8OFGWqfGK02UU1OqCN3VdwXyud66Ppvq+Zy5np qsKAcVGf4pMVukD5HS9VHLg64NgqolSjit141XNpvGEsDs1hdwMdLanueA3Mjub8aTh5 gbzojFOhVMLhTcJ8pfZt7VhTX7Q5Y+O/e8X+i/HInwYA20rWxuVzhGRRVWwbnmTw6STt cKm5ZtsDRcg6PjsVQokEycdHpUqriXOYw3vcr8lbpm8seffSSBIotxQOxH39BNeZBog5 usBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=HIa+YYglCZNjPmyv1kLr4BxW+P+La/cfiKl8aHygX4k=; b=U22szZ3ljwlR9HaIJ4wbhXeqMlacqzbdU25AXA5+gSd4TnQ0NOUfnLZovjU6sM6QN0 XgB8HaLx93ghG2wd713IPLwsWgDApqlUWqlAHPlqbH+lNnaAw9LvURZtDulCMILDIGeH ZYKs+5WdQqHsG9pk3Yqa58IGwI3YabV16QYN6EMu2IPSroohBWdfMLKrXL9QG+5/Af0h A1WNZTMiNY8l8DdWRfRO3g68i1ZS2i9U88F5WMwTrX1abjRoOHeYxIZYq2tsnQwI5/3Q ChmAPnZh1KfQVq4SvslS4K6iYbeZGJM7DarCU21E5XUjlR0htBWbBgQ5qbsyzuDtEh54 8fSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si4537083pgf.450.2019.01.18.04.22.03; Fri, 18 Jan 2019 04:22:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727740AbfARMUj (ORCPT + 99 others); Fri, 18 Jan 2019 07:20:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42066 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727589AbfARMU2 (ORCPT ); Fri, 18 Jan 2019 07:20:28 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6911D9D508; Fri, 18 Jan 2019 12:20:28 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9C815D96F; Fri, 18 Jan 2019 12:20:27 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8B0BB4FD6A; Fri, 18 Jan 2019 13:20:23 +0100 (CET) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Cc: Gerd Hoffmann , Dave Airlie , David Airlie , Daniel Vetter , virtualization@lists.linux-foundation.org (open list:DRM DRIVER FOR QXL VIRTUAL GPU), spice-devel@lists.freedesktop.org (open list:DRM DRIVER FOR QXL VIRTUAL GPU), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3 22/23] drm/qxl: use kernel mode db Date: Fri, 18 Jan 2019 13:20:19 +0100 Message-Id: <20190118122020.27596-23-kraxel@redhat.com> In-Reply-To: <20190118122020.27596-1-kraxel@redhat.com> References: <20190118122020.27596-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 18 Jan 2019 12:20:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add all standard modes from the kernel's video mode data base. Keep a few non-standard modes in the qxl mode list. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 926fcb49b2..df768b0c83 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -262,34 +262,20 @@ static int qxl_add_monitors_config_modes(struct drm_connector *connector) static struct mode_size { int w; int h; -} common_modes[] = { - { 640, 480}, +} extra_modes[] = { { 720, 480}, - { 800, 600}, - { 848, 480}, - {1024, 768}, {1152, 768}, - {1280, 720}, - {1280, 800}, {1280, 854}, - {1280, 960}, - {1280, 1024}, - {1440, 900}, - {1400, 1050}, - {1680, 1050}, - {1600, 1200}, - {1920, 1080}, - {1920, 1200} }; -static int qxl_add_common_modes(struct drm_connector *connector) +static int qxl_add_extra_modes(struct drm_connector *connector) { int i, ret = 0; - for (i = 0; i < ARRAY_SIZE(common_modes); i++) + for (i = 0; i < ARRAY_SIZE(extra_modes); i++) ret += qxl_add_mode(connector, - common_modes[i].w, - common_modes[i].h, + extra_modes[i].w, + extra_modes[i].h, false); return ret; } @@ -1010,7 +996,8 @@ static int qxl_conn_get_modes(struct drm_connector *connector) pheight = head->height; } - ret += qxl_add_common_modes(connector); + ret += drm_add_modes_noedid(connector, 8192, 8192); + ret += qxl_add_extra_modes(connector); ret += qxl_add_monitors_config_modes(connector); drm_set_preferred_mode(connector, pwidth, pheight); return ret; -- 2.9.3