From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B31CC433DF for ; Mon, 12 Oct 2020 11:20:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4BDEF2076E for ; Mon, 12 Oct 2020 11:20:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BDEF2076E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 827D36E25A; Mon, 12 Oct 2020 11:20:33 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6ADF86E25A for ; Mon, 12 Oct 2020 11:20:32 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1D376ACA3; Mon, 12 Oct 2020 11:20:31 +0000 (UTC) Date: Mon, 12 Oct 2020 13:20:30 +0200 From: Thomas Zimmermann To: Chris Wilson Subject: Re: [PATCH 2/3] drm/vkms: Switch to shmem helpers Message-ID: <20201012132030.0b8a48ae@linux-uq9g> In-Reply-To: <160250034327.30484.13309178658036116683@build.alporthouse.com> References: <20201009232156.3916879-1-daniel.vetter@ffwll.ch> <20201009232156.3916879-2-daniel.vetter@ffwll.ch> <160250034327.30484.13309178658036116683@build.alporthouse.com> Organization: SUSE Software Solutions Germany GmbH X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-suse-linux-gnu) MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haneen Mohammed , Rodrigo Siqueira , David Airlie , Daniel Vetter , Melissa Wen , DRI Development , Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, 12 Oct 2020 11:59:03 +0100 Chris Wilson wrote: > Quoting Daniel Vetter (2020-10-10 00:21:55) > > Inspired by a patch by Chris Wilson for vgem. Plus this gives us vmap > > at the gem bo level, which we need for generic fbdev emulation. > > > > Luckily shmem also tracks ->vaddr, so we just need to adjust the code > > all over a bit to make this fit. > > > > Also wire up handle_to_fd, dunno why that was missing. > > > > Signed-off-by: Daniel Vetter > > Cc: Chris Wilson > > Cc: Maarten Lankhorst > > Cc: Maxime Ripard > > Cc: Thomas Zimmermann > > Cc: David Airlie > > Cc: Daniel Vetter > > Cc: Rodrigo Siqueira > > Cc: Melissa Wen > > Cc: Haneen Mohammed > > --- > > diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c > > index 33c031f27c2c..66c6842d70db 100644 > > --- a/drivers/gpu/drm/vkms/vkms_composer.c > > +++ b/drivers/gpu/drm/vkms/vkms_composer.c > > @@ -5,6 +5,7 @@ > > #include > > #include > > #include > > +#include > > #include > > > static void vkms_release(struct drm_device *dev) > > { > > @@ -91,9 +82,11 @@ static struct drm_driver vkms_driver = { > > .driver_features = DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_GEM, > > .release = vkms_release, > > .fops = &vkms_driver_fops, > > - .dumb_create = vkms_dumb_create, > > + .dumb_create = drm_gem_shmem_dumb_create, > > Something worth pointing out is that will create an uncached (well WC) > buffer, but since it is being exported with prime, that is probably for I'd rather set .gem_create_object to drm_gem_shmem_create_object_cached() to get cached memory. We already have other drivers that do this. Best regards Thomas > the better. It might be worth using a memcpy_from_wc() for writeback/CRC > calculations. E.g. > > > @@ -129,15 +130,15 @@ static void compose_cursor(struct vkms_composer *cursor_composer, > > void *vaddr_out) > > { > > + blend(vaddr_out, cursor_shmem_obj->vaddr, > > primary_composer, cursor_composer); > > } > > > > @@ -147,20 +148,20 @@ static int compose_planes(void **vaddr_out, > > { > > + memcpy(*vaddr_out, shmem_obj->vaddr, shmem_obj->base.size); > > would benefit from WC accessors. > > On the other hand, if the load is so small no one notices, it can wait. > > Do we have anything that uses vkms in CI? > > Reviewed-by: Chris Wilson > -Chris _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel