From patchwork Thu Jul 12 02:02:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10520839 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 516AE6028E for ; Thu, 12 Jul 2018 02:02:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B03C2856D for ; Thu, 12 Jul 2018 02:02:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EC6328750; Thu, 12 Jul 2018 02:02:08 +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 CC99A2858A for ; Thu, 12 Jul 2018 02:02:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 840306ED76; Thu, 12 Jul 2018 02:02:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x231.google.com (mail-qk0-x231.google.com [IPv6:2607:f8b0:400d:c09::231]) by gabe.freedesktop.org (Postfix) with ESMTPS id 279406ED76 for ; Thu, 12 Jul 2018 02:02:05 +0000 (UTC) Received: by mail-qk0-x231.google.com with SMTP id z74-v6so14711203qkb.10 for ; Wed, 11 Jul 2018 19:02:05 -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=N7uDccp0tnVSeQxvZzKd12mJa21gvneLRXn8lKeW8YA=; b=cbETSRDOxbMjitAWzABZVc9AQTlP/5Fx7gT08EQfurS92+jtkJbG4ZqQX/qLRFPuqX Qh0OafCMHOpiZUmCYdxxWxdRfdhONLQIid0+wNDOTjuNMU/9YjzzrLDEPHLJ5zlZnhix zPNCd1Z75pgS5hvF4T8EiKRh1mxQ+zvHhAZ5DIgI+daTtAv0RAItVDqfnJn/rnmHma0M 3q3uAm3kcQTN4NsKDISICm2cQIb7swEDiSAx5aB4lBPIy3nAahg79qwV4TktxcrvW2PD 6lE4wsn7AB+9ncM9CgO95TTCsgW7dmeQBToq9Zbes1SedZfBNRdEc/OrPpIjfhLotvC2 tUGg== X-Gm-Message-State: AOUpUlH8v+R5tFT56qyk8m1phgWlcW5bfxsSiN5r3DMPgp9I3hKvdlNt aE9zUssMCjy1lySdl/BeKdw= X-Google-Smtp-Source: AAOMgpfgvQ8LrZ5/30HTm6MBr0Ro7KvqqXGfxlZzK5H6YBGw7M8KlxzGGG66c9OIMQaDYkG20dNB1w== X-Received: by 2002:a37:7d87:: with SMTP id y129-v6mr236945qkc.232.1531360924268; Wed, 11 Jul 2018 19:02:04 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id j128-v6sm13878852qkc.50.2018.07.11.19.02.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 19:02:03 -0700 (PDT) Date: Wed, 11 Jul 2018 23:02:01 -0300 From: Rodrigo Siqueira To: Daniel Vetter , Gustavo Padovan , Sean Paul , Haneen Mohammed Subject: [PATCH V3 2/4] drm/vkms: Add framebuffer and plane helpers Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180622 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 This patch appends the minimum helpers related to framebuffer and plane to make vkms minimally usable. Changes since V1: - None Changes since V2: - Squash "Add plane helper struct" and "Add helper for framebuffer create" Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/vkms/vkms_drv.c | 3 +++ drivers/gpu/drm/vkms/vkms_plane.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index 6ea2fd97bef9..b5d597a42f20 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include "vkms_drv.h" #define DRIVER_NAME "vkms" @@ -69,6 +71,7 @@ static struct drm_driver vkms_driver = { }; static const struct drm_mode_config_funcs vkms_mode_funcs = { + .fb_create = drm_gem_fb_create, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, }; diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c index 2c25b1d6ab5b..f7f63143f6d0 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -19,6 +19,22 @@ static const struct drm_plane_funcs vkms_plane_funcs = { .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, }; +static int vkms_plane_atomic_check(struct drm_plane *plane, + struct drm_plane_state *state) +{ + return 0; +} + +static void vkms_primary_plane_update(struct drm_plane *plane, + struct drm_plane_state *old_state) +{ +} + +static const struct drm_plane_helper_funcs vkms_primary_helper_funcs = { + .atomic_check = vkms_plane_atomic_check, + .atomic_update = vkms_primary_plane_update, +}; + struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev) { struct drm_device *dev = &vkmsdev->drm; @@ -42,5 +58,7 @@ struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev) return ERR_PTR(ret); } + drm_plane_helper_add(plane, &vkms_primary_helper_funcs); + return plane; }