From patchwork Thu Oct 4 20:24:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10626627 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA3BD174A for ; Thu, 4 Oct 2018 20:25:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD408296F1 for ; Thu, 4 Oct 2018 20:25:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1597296FF; Thu, 4 Oct 2018 20:25:20 +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,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 60962296F1 for ; Thu, 4 Oct 2018 20:25:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F228D6E671; Thu, 4 Oct 2018 20:25:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4FF7E6E66D for ; Thu, 4 Oct 2018 20:25:09 +0000 (UTC) Received: by mail-ed1-x541.google.com with SMTP id j62-v6so9743622edd.7 for ; Thu, 04 Oct 2018 13:25:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x1YafBY3jn9l9P4MSdF+vgN8y7NL01qleNPHPOqgukA=; b=Z44RcqvivQ9m9Q26eVmdMHhjIz1gezMawp6f+tZQo4so7TyIJfVYbnOqIsDRjt4j3U /5ApcDz5TUdzSoWQZ0ERIlWOQpBRJj/X/K7MUz8onG8jmOZdGxGybvbdr1tDwki4tNiY 33W3C6lUGD8iNJVOzDeI9lB4gi2+ki4ZiJgw/eYCMJj+18Q8pQMjdMQTmH8GukZbBUK6 Poiz8/Josutya/c07kY9pSWxpVWyx4ua01SkAr8uPYZnUAgHcHNBjXTREQwTJGP/4s7Y R0VJ7iXjBIelMW3DVaRKD+8wgThY3ouHyQw/1hTCEzSuFFpeTBbjJgUHPhcsuxSPrXLJ LbDQ== X-Gm-Message-State: ABuFfojfY7eQ7ekEVbIoXzPW7yYXTkUezPYOUfKk1ul2cEFhkJNAbrQE PCB3ftWbpiT6amC8+i1nULXwBCJfTQ8= X-Google-Smtp-Source: ACcGV60AxLe6YS7jInU5AgbWDpE3SSEMLrRPB7M4NaQ0uMfeGg5ajN5SxEXRWLLHBoTbzA52v43LhA== X-Received: by 2002:a50:90d8:: with SMTP id d24-v6mr8438033eda.228.1538684707377; Thu, 04 Oct 2018 13:25:07 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id y8-v6sm2040002edd.43.2018.10.04.13.25.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Oct 2018 13:25:06 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 07/21] drm/vmwgfx: Add FIXME comments for customer page_flip handlers Date: Thu, 4 Oct 2018 22:24:32 +0200 Message-Id: <20181004202446.22905-8-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.19.0.rc2 In-Reply-To: <20181004202446.22905-1-daniel.vetter@ffwll.ch> References: <20181004202446.22905-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 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: Daniel Vetter , Thomas Hellstrom , VMware Graphics , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The idea behind allowing drivers to override legacy ioctls (instead of using the generic implementations unconditionally) is to handle bugs in old driver-specific userspace. Like e.g. vmw_kms_set_config does, to work around some vmwgfx userspace not clearing its ioctl structs properly. But you can't use it to augment semantics and put in additional checks, since from a correctly working userspace's pov there should not be any difference in behaviour between the legacy and the atomic paths. vmwgfx seems to be doing some strange things in its page_flip handlers. Since I'm not an expert of this codebase just wrap some FIXME comments around the potentially problematic code. Signed-off-by: Daniel Vetter Cc: VMware Graphics Cc: Sinclair Yeh Cc: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 2 ++ drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index 333418dc259f..0bdf785f2aad 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c @@ -326,6 +326,7 @@ static int vmw_sou_crtc_page_flip(struct drm_crtc *crtc, struct vmw_private *dev_priv = vmw_priv(crtc->dev); int ret; + /* FIMXE: This check needs to be moved into ->atomic_check code. */ if (!vmw_kms_crtc_flippable(dev_priv, crtc)) return -EINVAL; @@ -335,6 +336,7 @@ static int vmw_sou_crtc_page_flip(struct drm_crtc *crtc, return ret; } + /* FIMXE: This code needs to be moved into ->atomic_commit callbacks. */ if (vmw_crtc_to_du(crtc)->is_implicit) vmw_kms_update_implicit_fb(dev_priv, crtc); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index c3e435f444c1..b8f4be159f91 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -501,6 +501,7 @@ static int vmw_stdu_crtc_page_flip(struct drm_crtc *crtc, struct vmw_screen_target_display_unit *stdu = vmw_crtc_to_stdu(crtc); int ret; + /* FIMXE: This check needs to be moved into ->atomic_check code. */ if (!stdu->defined || !vmw_kms_crtc_flippable(dev_priv, crtc)) return -EINVAL;