From patchwork Tue May 22 12:16:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10418491 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 711D46032A for ; Tue, 22 May 2018 12:16:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 595EE28823 for ; Tue, 22 May 2018 12:16:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B47828C67; Tue, 22 May 2018 12:16:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E0A8028823 for ; Tue, 22 May 2018 12:16:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 04C0A6E284; Tue, 22 May 2018 12:16:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2D1996E284 for ; Tue, 22 May 2018 12:16:36 +0000 (UTC) Received: by mail-qt0-x243.google.com with SMTP id q13-v6so23045616qtp.4 for ; Tue, 22 May 2018 05:16:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lUQM+AGz1Eg0uRXLBgFGK/8dByzTUB9eZw+RZU1Pbz4=; b=d20c7L39tcttqpfflJkDmoqYXQQMk9RNwAbVoQ3YuOedh6Rj3mCIglSJ5PUAUpM4qK L8q8ptGAl8GfB+UGYI8/ngi3zvqTIxHNoqBWxGszAdy3KS3FcXvBCCNxmsjQaKjGoXhv 6WKvSISVdsmXwEcIgjH26YUV0fY2bBKWL2M0MI7rifs8yL2RtWmia3V8ndgMdL0CUEYu DBVJkJF8m7LfrNDDxgwaWKAkTds4C66DauQ54ljVTVcQskParX0QIM/HHjIwerq38cXo A1UrrFPq/MxOPnWZqo6l56mFodEU00WGJ9m7CPvGMnb3YcXg+JRugJKojylwMGhCwFpc UvwQ== X-Gm-Message-State: ALKqPwcg88AtWUlOIMljAsJCypjUg9IaRy65Ak0sGAFs7eBNu6eeFjSt yTbyn/699Vi76GQgampmpWM= X-Google-Smtp-Source: AB8JxZoDvkLCLwYcIqylP0Fu3hYgUVAcxMnnufRlwQybsPLr5FvNQXE34LACX1++AEcZ30uf+SHL5Q== X-Received: by 2002:ac8:1488:: with SMTP id l8-v6mr22074124qtj.182.1526991395202; Tue, 22 May 2018 05:16:35 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id o32-v6sm11880639qte.17.2018.05.22.05.16.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 May 2018 05:16:34 -0700 (PDT) Date: Tue, 22 May 2018 09:16:31 -0300 From: Rodrigo Siqueira To: Gustavo Padovan , Daniel Vetter , Sean Paul , Haneen Mohammed Subject: [PATCH V4 1/3] drm/vkms: Add mode_config initialization Message-ID: <94d355d47b15f047d6d650dc40cbca9cc9fd84bd.1526990393.git.rodrigosiqueiramelo@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Set a frame buffer default size for width and height (minimum and maximum). Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/vkms/vkms_drv.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index 35517b09538e..aec3f180f96d 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "vkms_drv.h" #define DRIVER_NAME "vkms" @@ -17,6 +18,12 @@ #define DRIVER_MAJOR 1 #define DRIVER_MINOR 0 +#define XRES_MIN 32 +#define YRES_MIN 32 + +#define XRES_MAX 8192 +#define YRES_MAX 8192 + static struct vkms_device *vkms_device; static const struct file_operations vkms_driver_fops = { @@ -67,6 +74,11 @@ static const struct drm_connector_funcs vkms_connector_funcs = { .destroy = vkms_connector_destroy, }; +static const struct drm_mode_config_funcs vkms_mode_funcs = { + .atomic_check = drm_atomic_helper_check, + .atomic_commit = drm_atomic_helper_commit, +}; + static int __init vkms_init(void) { int ret; @@ -87,6 +99,11 @@ static int __init vkms_init(void) } drm_mode_config_init(&vkms_device->drm); + vkms_device->drm.mode_config.funcs = &vkms_mode_funcs; + vkms_device->drm.mode_config.min_width = XRES_MIN; + vkms_device->drm.mode_config.min_height = YRES_MIN; + vkms_device->drm.mode_config.max_width = XRES_MAX; + vkms_device->drm.mode_config.max_height = YRES_MAX; ret = drm_connector_init(&vkms_device->drm, &vkms_device->connector, &vkms_connector_funcs,