From patchwork Wed May 16 23:55:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10405137 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 1965C601D2 for ; Wed, 16 May 2018 23:55:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0571C2869D for ; Wed, 16 May 2018 23:55:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAFE4287E7; Wed, 16 May 2018 23:55:42 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 86D412869D for ; Wed, 16 May 2018 23:55:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9937D6E570; Wed, 16 May 2018 23:55:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id C14456E570 for ; Wed, 16 May 2018 23:55:40 +0000 (UTC) Received: by mail-qt0-x242.google.com with SMTP id f1-v6so3528272qtj.6 for ; Wed, 16 May 2018 16:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xW+nBT4vuvIFOylPW4sS2vQ1Zfd6L2iR3FvWR6f7jJ4=; b=fzYtyfulSYGLq5wODkwMzBZ4/ipenm+4p5o97jUE65QbdUZpfVLjvo2JA8V/6IiJ/u Xrk0TkxebyC9HDCZqu3SWCa5Mu8aK1QRX1SdO+dAOsLsNnHeKbYeWZkSeTpwoyD28OYv iFLG5exROts9DlBIN6t6m0URhX2O1u2PSjcQrRf23ipUZkkhh0iYrmko4fJ2sAglL/4f afj7UNiTWaeFgmj8MlaXAWKND36qBBinOUkZ5OQRUUKjPcsOREJA/D4zjvzM9A0DznSE lKhpj2knaWhpFWUJQ5YCLpjfgfYu3DLnF1SAG8zWZwwXbKmuCQeYqm2KiVPF4sjl+BKc 2tgQ== 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=xW+nBT4vuvIFOylPW4sS2vQ1Zfd6L2iR3FvWR6f7jJ4=; b=FlnY/zzr6gSrB9oVWwtBCBmDFVY/lx7kukMFxAVoKb8XUeYfoYxDPnUoRrZbbvrnsq j08abZs3fTJdBj4qN5KkQer2Yarwij+FGFeufrQjtYjem7pECKNRGimzWLdkWVB/49Wh GEFG4rhPIOHQBr01Sn7mxn+ffTmAH1awuiciXDPnOZM395u2WhP9AmChi7nn9guZxMLX tQLK1oab/2672Vw5YDlhPz5vRBp6mI6p9oihAXFtpW2ySOrBp3IgjfLAaxSIKKBKwwfN 6Ua/hGbiLNDOz2oGMIlVYNElwA45c8xeNpx0eycrzAhUFMnSEsaBzWQSo9qvztMLx1rE 0ZTw== X-Gm-Message-State: ALKqPwfmVI1xDN7Dso5YaMwx1D4EtAGV02r49U3vvO48ktNkeVvtWd7Y 7tysHUQWJMz3JHvZSSkmak0= X-Google-Smtp-Source: AB8JxZrIXRZs7CSFtRdHDsUiWPqTyNbjblbzXqcRIHEdGtnTLwcAXO51y7PDYXoZU1bcnY37A3RGrQ== X-Received: by 2002:aed:25b6:: with SMTP id x51-v6mr3238010qtc.51.1526514939816; Wed, 16 May 2018 16:55:39 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id b13-v6sm2556123qtp.89.2018.05.16.16.55.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 16:55:39 -0700 (PDT) Date: Wed, 16 May 2018 20:55:36 -0300 From: Rodrigo Siqueira To: Gustavo Padovan , Daniel Vetter , Sean Paul , Haneen Mohammed Subject: [PATCH v2 1/3] drm/vkms: Add mode_config initialization Message-ID: <75c55df671f24b037f9172700b479f4bb2fa7c92.1526514457.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 Initialize minimum and maximum width and height of the frame buffers with default values. 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,