From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0AD5C43217 for ; Fri, 22 Oct 2021 13:28:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAF1261208 for ; Fri, 22 Oct 2021 13:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231564AbhJVNbA (ORCPT ); Fri, 22 Oct 2021 09:31:00 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:55414 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230453AbhJVNax (ORCPT ); Fri, 22 Oct 2021 09:30:53 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EC2C521990; Fri, 22 Oct 2021 13:28:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1634909314; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AnqzhGT0uv+LTZRPyyPSUgnVBDbveGG6+0StxQzTfpo=; b=Xx0gEuvNxXWPSh54tHYaynORHIDZOjYsdzLSm4Jtv6Q5Ux2purRHu7bNabi7AB+uLcUk7X ceLy2ETmN6Dcf2o7HBznqjguw9it6+5dMIVhmLfA4/tRZKSEaviasrMcA8V9utkoqPghxY JbOUOliPKBtcNr5mJsQpPONH/3p/vQ8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1634909314; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AnqzhGT0uv+LTZRPyyPSUgnVBDbveGG6+0StxQzTfpo=; b=JHYjhlndi6DDIxc6dCkc5CMM+ybAOtJObL2FTl1vz/Yvvc47vlLN5mjNOIgnZFWHo6OAro ik6Vf3bdhDNYyDAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8258213CDA; Fri, 22 Oct 2021 13:28:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wMjGHoK8cmEwXgAAMHmgww (envelope-from ); Fri, 22 Oct 2021 13:28:34 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@linux.ie, mripard@kernel.org, maarten.lankhorst@linux.intel.com, noralf@tronnes.org, drawat.floss@gmail.com, airlied@redhat.com, kraxel@redhat.com, david@lechnology.com, sam@ravnborg.org, javierm@redhat.com, kernel@amanoeldawod.com, dirty.ice.hu@gmail.com, michael+lkml@stapelberg.ch, aros@gmx.com, joshua@stroblindustries.com, arnd@arndb.de Cc: dri-devel@lists.freedesktop.org, linux-hyperv@vger.kernel.org, virtualization@lists.linux-foundation.org, Thomas Zimmermann Subject: [PATCH 9/9] drm: Clarify semantics of struct drm_mode_config.{min,max}_{width,height} Date: Fri, 22 Oct 2021 15:28:29 +0200 Message-Id: <20211022132829.7697-10-tzimmermann@suse.de> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211022132829.7697-1-tzimmermann@suse.de> References: <20211022132829.7697-1-tzimmermann@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org Add additional information on the semantics of the size fields in struct drm_mode_config. Also add a TODO to review all driver for correct usage of these fields. Signed-off-by: Thomas Zimmermann --- Documentation/gpu/todo.rst | 15 +++++++++++++++ include/drm/drm_mode_config.h | 13 +++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 60d1d7ee0719..f4e1d72149f7 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -463,6 +463,21 @@ Contact: Thomas Zimmermann , Christian König, Daniel Vette Level: Intermediate +Review all drivers for setting struct drm_mode_config.{max_width,max_height} correctly +-------------------------------------------------------------------------------------- + +The values in struct drm_mode_config.{max_width,max_height} describe the +maximum supported framebuffer size. It's the virtual screen size, but many +drivers treat it like limitations of the physical resolution. + +The maximum width depends on the hardware's maximum scanline pitch. The +maximum height depends on the amount of addressable video memory. Review all +drivers to initialize the fields to the correct values. + +Contact: Thomas Zimmermann + +Level: Intermediate + Core refactorings ================= diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 48b7de80daf5..91ca575a78de 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -359,6 +359,19 @@ struct drm_mode_config_funcs { * Core mode resource tracking structure. All CRTC, encoders, and connectors * enumerated by the driver are added here, as are global properties. Some * global restrictions are also here, e.g. dimension restrictions. + * + * Framebuffer sizes refer to the virtual screen that can be displayed by + * the CRTC. This can be different from the physical resolution programmed. + * The minimum width and height, stored in @min_width and @min_height, + * describe the smallest size of the framebuffer. It correlates to the + * minimum programmable resolution. + * The maximum width, stored in @max_width, is typically limited by the + * maximum pitch between two adjacent scanlines. The maximum height, stored + * in @max_height, is usually only limited by the amount of addressable video + * memory. For hardware that has no real maximum, drivers should pick a + * reasonable default. + * + * See also @DRM_SHADOW_PLANE_MAX_WIDTH and @DRM_SHADOW_PLANE_MAX_HEIGHT. */ struct drm_mode_config { /** -- 2.33.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66CB7C433EF for ; Fri, 22 Oct 2021 13:28:45 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E33961205 for ; Fri, 22 Oct 2021 13:28:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2E33961205 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7ED5483B5F; Fri, 22 Oct 2021 13:28:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5HSeZrmm87Nz; Fri, 22 Oct 2021 13:28:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 73F8B83B37; Fri, 22 Oct 2021 13:28:41 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2B17DC0045; Fri, 22 Oct 2021 13:28:40 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 809B7C0034 for ; Fri, 22 Oct 2021 13:28:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5FF5183B20 for ; Fri, 22 Oct 2021 13:28:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2QWJ2ppi9FD5 for ; Fri, 22 Oct 2021 13:28:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by smtp1.osuosl.org (Postfix) with ESMTPS id A069483B1B for ; Fri, 22 Oct 2021 13:28:36 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EC2C521990; Fri, 22 Oct 2021 13:28:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1634909314; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AnqzhGT0uv+LTZRPyyPSUgnVBDbveGG6+0StxQzTfpo=; b=Xx0gEuvNxXWPSh54tHYaynORHIDZOjYsdzLSm4Jtv6Q5Ux2purRHu7bNabi7AB+uLcUk7X ceLy2ETmN6Dcf2o7HBznqjguw9it6+5dMIVhmLfA4/tRZKSEaviasrMcA8V9utkoqPghxY JbOUOliPKBtcNr5mJsQpPONH/3p/vQ8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1634909314; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AnqzhGT0uv+LTZRPyyPSUgnVBDbveGG6+0StxQzTfpo=; b=JHYjhlndi6DDIxc6dCkc5CMM+ybAOtJObL2FTl1vz/Yvvc47vlLN5mjNOIgnZFWHo6OAro ik6Vf3bdhDNYyDAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8258213CDA; Fri, 22 Oct 2021 13:28:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wMjGHoK8cmEwXgAAMHmgww (envelope-from ); Fri, 22 Oct 2021 13:28:34 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@linux.ie, mripard@kernel.org, maarten.lankhorst@linux.intel.com, noralf@tronnes.org, drawat.floss@gmail.com, airlied@redhat.com, kraxel@redhat.com, david@lechnology.com, sam@ravnborg.org, javierm@redhat.com, kernel@amanoeldawod.com, dirty.ice.hu@gmail.com, michael+lkml@stapelberg.ch, aros@gmx.com, joshua@stroblindustries.com, arnd@arndb.de Subject: [PATCH 9/9] drm: Clarify semantics of struct drm_mode_config.{min, max}_{width, height} Date: Fri, 22 Oct 2021 15:28:29 +0200 Message-Id: <20211022132829.7697-10-tzimmermann@suse.de> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211022132829.7697-1-tzimmermann@suse.de> References: <20211022132829.7697-1-tzimmermann@suse.de> MIME-Version: 1.0 Cc: linux-hyperv@vger.kernel.org, Thomas Zimmermann , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" QWRkIGFkZGl0aW9uYWwgaW5mb3JtYXRpb24gb24gdGhlIHNlbWFudGljcyBvZiB0aGUgc2l6ZSBm aWVsZHMgaW4Kc3RydWN0IGRybV9tb2RlX2NvbmZpZy4gQWxzbyBhZGQgYSBUT0RPIHRvIHJldmll dyBhbGwgZHJpdmVyIGZvcgpjb3JyZWN0IHVzYWdlIG9mIHRoZXNlIGZpZWxkcy4KClNpZ25lZC1v ZmYtYnk6IFRob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPgotLS0KIERvY3Vt ZW50YXRpb24vZ3B1L3RvZG8ucnN0ICAgIHwgMTUgKysrKysrKysrKysrKysrCiBpbmNsdWRlL2Ry bS9kcm1fbW9kZV9jb25maWcuaCB8IDEzICsrKysrKysrKysrKysKIDIgZmlsZXMgY2hhbmdlZCwg MjggaW5zZXJ0aW9ucygrKQoKZGlmZiAtLWdpdCBhL0RvY3VtZW50YXRpb24vZ3B1L3RvZG8ucnN0 IGIvRG9jdW1lbnRhdGlvbi9ncHUvdG9kby5yc3QKaW5kZXggNjBkMWQ3ZWUwNzE5Li5mNGUxZDcy MTQ5ZjcgMTAwNjQ0Ci0tLSBhL0RvY3VtZW50YXRpb24vZ3B1L3RvZG8ucnN0CisrKyBiL0RvY3Vt ZW50YXRpb24vZ3B1L3RvZG8ucnN0CkBAIC00NjMsNiArNDYzLDIxIEBAIENvbnRhY3Q6IFRob21h cyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPiwgQ2hyaXN0aWFuIEvDtm5pZywgRGFu aWVsIFZldHRlCiAKIExldmVsOiBJbnRlcm1lZGlhdGUKIAorUmV2aWV3IGFsbCBkcml2ZXJzIGZv ciBzZ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 d28gYWRqYWNlbnQgc2NhbmxpbmVzLiBUaGUgbWF4aW11bSBoZWlnaHQsIHN0b3JlZAorICogaW4g QG1heF9oZWlnaHQsIGlzIHVzdWFsbHkgb25seSBsaW1pdGVkIGJ5IHRoZSBhbW91bnQgb2YgYWRk cmVzc2FibGUgdmlkZW8KKyAqIG1lbW9yeS4gRm9yIGhhcmR3YXJlIHRoYXQgaGFzIG5vIHJlYWwg bWF4aW11bSwgZHJpdmVycyBzaG91bGQgcGljayBhCisgKiByZWFzb25hYmxlIGRlZmF1bHQuCisg KgorICogU2VlIGFsc28gQERSTV9TSEFET1dfUExBTkVfTUFYX1dJRFRIIGFuZCBARFJNX1NIQURP V19QTEFORV9NQVhfSEVJR0hULgogICovCiBzdHJ1Y3QgZHJtX21vZGVfY29uZmlnIHsKIAkvKioK LS0gCjIuMzMuMAoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X18KVmlydHVhbGl6YXRpb24gbWFpbGluZyBsaXN0ClZpcnR1YWxpemF0aW9uQGxpc3RzLmxpbnV4 LWZvdW5kYXRpb24ub3JnCmh0dHBzOi8vbGlzdHMubGludXhmb3VuZGF0aW9uLm9yZy9tYWlsbWFu L2xpc3RpbmZvL3ZpcnR1YWxpemF0aW9u From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75A6EC4321E for ; Fri, 22 Oct 2021 13:28:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 467746112F for ; Fri, 22 Oct 2021 13:28:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 467746112F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C8F36ED95; Fri, 22 Oct 2021 13:28:39 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 614946ED8A for ; Fri, 22 Oct 2021 13:28:36 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EC2C521990; Fri, 22 Oct 2021 13:28:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1634909314; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AnqzhGT0uv+LTZRPyyPSUgnVBDbveGG6+0StxQzTfpo=; b=Xx0gEuvNxXWPSh54tHYaynORHIDZOjYsdzLSm4Jtv6Q5Ux2purRHu7bNabi7AB+uLcUk7X ceLy2ETmN6Dcf2o7HBznqjguw9it6+5dMIVhmLfA4/tRZKSEaviasrMcA8V9utkoqPghxY JbOUOliPKBtcNr5mJsQpPONH/3p/vQ8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1634909314; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AnqzhGT0uv+LTZRPyyPSUgnVBDbveGG6+0StxQzTfpo=; b=JHYjhlndi6DDIxc6dCkc5CMM+ybAOtJObL2FTl1vz/Yvvc47vlLN5mjNOIgnZFWHo6OAro ik6Vf3bdhDNYyDAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8258213CDA; Fri, 22 Oct 2021 13:28:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wMjGHoK8cmEwXgAAMHmgww (envelope-from ); Fri, 22 Oct 2021 13:28:34 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@linux.ie, mripard@kernel.org, maarten.lankhorst@linux.intel.com, noralf@tronnes.org, drawat.floss@gmail.com, airlied@redhat.com, kraxel@redhat.com, david@lechnology.com, sam@ravnborg.org, javierm@redhat.com, kernel@amanoeldawod.com, dirty.ice.hu@gmail.com, michael+lkml@stapelberg.ch, aros@gmx.com, joshua@stroblindustries.com, arnd@arndb.de Cc: dri-devel@lists.freedesktop.org, linux-hyperv@vger.kernel.org, virtualization@lists.linux-foundation.org, Thomas Zimmermann Subject: [PATCH 9/9] drm: Clarify semantics of struct drm_mode_config.{min, max}_{width, height} Date: Fri, 22 Oct 2021 15:28:29 +0200 Message-Id: <20211022132829.7697-10-tzimmermann@suse.de> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211022132829.7697-1-tzimmermann@suse.de> References: <20211022132829.7697-1-tzimmermann@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add additional information on the semantics of the size fields in struct drm_mode_config. Also add a TODO to review all driver for correct usage of these fields. Signed-off-by: Thomas Zimmermann --- Documentation/gpu/todo.rst | 15 +++++++++++++++ include/drm/drm_mode_config.h | 13 +++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 60d1d7ee0719..f4e1d72149f7 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -463,6 +463,21 @@ Contact: Thomas Zimmermann , Christian König, Daniel Vette Level: Intermediate +Review all drivers for setting struct drm_mode_config.{max_width,max_height} correctly +-------------------------------------------------------------------------------------- + +The values in struct drm_mode_config.{max_width,max_height} describe the +maximum supported framebuffer size. It's the virtual screen size, but many +drivers treat it like limitations of the physical resolution. + +The maximum width depends on the hardware's maximum scanline pitch. The +maximum height depends on the amount of addressable video memory. Review all +drivers to initialize the fields to the correct values. + +Contact: Thomas Zimmermann + +Level: Intermediate + Core refactorings ================= diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 48b7de80daf5..91ca575a78de 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -359,6 +359,19 @@ struct drm_mode_config_funcs { * Core mode resource tracking structure. All CRTC, encoders, and connectors * enumerated by the driver are added here, as are global properties. Some * global restrictions are also here, e.g. dimension restrictions. + * + * Framebuffer sizes refer to the virtual screen that can be displayed by + * the CRTC. This can be different from the physical resolution programmed. + * The minimum width and height, stored in @min_width and @min_height, + * describe the smallest size of the framebuffer. It correlates to the + * minimum programmable resolution. + * The maximum width, stored in @max_width, is typically limited by the + * maximum pitch between two adjacent scanlines. The maximum height, stored + * in @max_height, is usually only limited by the amount of addressable video + * memory. For hardware that has no real maximum, drivers should pick a + * reasonable default. + * + * See also @DRM_SHADOW_PLANE_MAX_WIDTH and @DRM_SHADOW_PLANE_MAX_HEIGHT. */ struct drm_mode_config { /** -- 2.33.0