From patchwork Tue May 22 01:04:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10417179 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 3C1ED6032C for ; Tue, 22 May 2018 01:05:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AD8A28A16 for ; Tue, 22 May 2018 01:05:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DA0F28A4A; Tue, 22 May 2018 01:05:04 +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 A60FC28A16 for ; Tue, 22 May 2018 01:05:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CABD36E098; Tue, 22 May 2018 01:05:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id D07446E098 for ; Tue, 22 May 2018 01:05:01 +0000 (UTC) Received: by mail-qk0-x242.google.com with SMTP id r28-v6so11026373qkk.4 for ; Mon, 21 May 2018 18:05:01 -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=L18I8vcI/tywkOBi645weONrfRhN5hkG+OLZMniLtnjODKRWs2pG8Po7SYrCnABm0a i8bkPpWs47MtkKJb/EarwAYPtw4S3nTv8C82WvrlBwQ3ihRN4xMhpXHY0x7Qs7HUKwqK yAxwqLUL3J1ogeRld+22fTHfQJwva8bfh83gq4sBHAlnHXGZzVmtnA4DnWUTt8+Tdgwi lP/VrrhRCp4p5jGChdCl9yKC77ZjJfxZNYP+cO/OEXh4R4xayv5m3PCP10ISxEgqE0/z q9LKhLy2WqlB2uNF1fFuhyjA+SkaUjHejEibSLiqmvV3Gu4WYD2HJa2SNOXXAse9HY23 s+4g== X-Gm-Message-State: ALKqPwfL0LCubct7TFIprH50F0bXkkp1kMeKSoQEqnrtWTFRK+eVIhi2 bvvskstrm891MxYoJ5K50d8= X-Google-Smtp-Source: AB8JxZqJTlJzspqVWt8Tti8oXtsh9fLYYZam7FgdWpR7648UTByvG+a/tqYG09O/sa0nS9buN6T6gQ== X-Received: by 2002:a37:5ac5:: with SMTP id o188-v6mr18728359qkb.295.1526951100992; Mon, 21 May 2018 18:05:00 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id q8-v6sm11823252qtb.13.2018.05.21.18.04.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 May 2018 18:04:59 -0700 (PDT) Date: Mon, 21 May 2018 22:04:57 -0300 From: Rodrigo Siqueira To: Gustavo Padovan , Daniel Vetter , Sean Paul , Haneen Mohammed Subject: [PATCH V3 1/3] drm/vkms: Add mode_config initialization Message-ID: <94d355d47b15f047d6d650dc40cbca9cc9fd84bd.1526948540.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,