From patchwork Thu Jul 12 13:41:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10521697 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 252A8602B3 for ; Thu, 12 Jul 2018 13:41:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04C64299D6 for ; Thu, 12 Jul 2018 13:41:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 029EA29A96; Thu, 12 Jul 2018 13:41:09 +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 A48C729988 for ; Thu, 12 Jul 2018 13:41:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A80C96EFC3; Thu, 12 Jul 2018 13:41:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 72B4F6EFC1 for ; Thu, 12 Jul 2018 13:41:06 +0000 (UTC) Received: by mail-qt0-x241.google.com with SMTP id a5-v6so9537200qtp.2 for ; Thu, 12 Jul 2018 06:41:06 -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=i9+MMIh1hdGWx4BvN06CXfo3WRPkVhsvnxip80iKiHY=; b=UDGTC+u4X7YATHP14UFnWZCWXfiUWpanKpJv00JXZWH8pLFvA+b3s/bPOqwxrmKgTr 0ygPFb5kDGxnaQzJ55E3cHcTYOQlc4S5zhW/NubrsyVxTFWxvaDo+5Qk6K+cwf9W77d7 bnnaBEf3WXt+Hx+9Zq1x1FbF17VMNGWo07+k0on9bP1UhdxbU6V3xSMWkOfLErT4jzzg N6JDFaagZ1RE8SgZIRoC1a5Kvwvsqgu0vRrTrWgUHzoM7jY35gR3EviNcGUAYkPKftCf aMBvuwLsnOo7Rwxbsby1FDYafQIE5wtIyzmtYODtyAXWQtsJPz6xDNR0OKFMYBNwR9cI TZ5Q== X-Gm-Message-State: AOUpUlG3B3eMxFrjc9ZBwNsNewhk95R1Vq8gbAyXQFe/KrsaB/CjBWj7 tY9Q5IZ5uFfczvnJXGzfg1A= X-Google-Smtp-Source: AAOMgpdxRXdK6oG7jSPpcBG5VM8wm796LiIKKc/XS8vO4c9P8k6RIdynermX8bMpy0cYyAF4QkiaMQ== X-Received: by 2002:ac8:3fcd:: with SMTP id v13-v6mr1847210qtk.250.1531402865681; Thu, 12 Jul 2018 06:41:05 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id p35-v6sm13010622qtp.63.2018.07.12.06.41.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 06:41:05 -0700 (PDT) Date: Thu, 12 Jul 2018 10:41:02 -0300 From: Rodrigo Siqueira To: Daniel Vetter , Gustavo Padovan , Sean Paul , Haneen Mohammed Subject: [PATCH V4 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" Changes since V3: Daniel Vetter: - Remove atomic_check from plane helper Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/vkms/vkms_drv.c | 3 +++ drivers/gpu/drm/vkms/vkms_plane.c | 11 +++++++++++ 2 files changed, 14 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..9f75b1e2c1c4 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -19,6 +19,15 @@ static const struct drm_plane_funcs vkms_plane_funcs = { .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, }; +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_update = vkms_primary_plane_update, +}; + struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev) { struct drm_device *dev = &vkmsdev->drm; @@ -42,5 +51,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; }