From patchwork Mon Sep 3 16:54:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10586193 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 534F45A4 for ; Mon, 3 Sep 2018 16:56:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4268428A73 for ; Mon, 3 Sep 2018 16:56:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3604F28F5D; Mon, 3 Sep 2018 16:56:19 +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 DA12428A73 for ; Mon, 3 Sep 2018 16:56:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 201436E2CD; Mon, 3 Sep 2018 16:55:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A07E6E2C1 for ; Mon, 3 Sep 2018 16:55:08 +0000 (UTC) Received: by mail-ed1-x542.google.com with SMTP id f4-v6so1249174edq.3 for ; Mon, 03 Sep 2018 09:55:08 -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; bh=iJFc0f0FVqUTq6NBMvlGn5NXn/bbANKECNzmbaTTv8s=; b=eFM8xDIFef6EHLEB7J7qUKHGoIgH27z9EQ2dzpZEMRnptf2S1VOsjssx/1rGqQzkLo R4WyBdGBfHGZgQELSVBOyBDBPCZrqe/fM99m9hiBhEmOfLGQlVGTcZZUvF15U8YsptsJ eFWzckWArV7TKtOTF0dJXuwUaHHIxBkMFoGOgyQHBkeYN0sUh5f7Jxx6L0EneyCYe/8k SsJRTi7nsw6VUcVbbLluh/CizyLrRS/PVeZmCOAO4LzcYLzn9jTNz/hk9Yp1W5AzSQi1 P5k0jVCnWJXP13T6lBKOS4isxwRAGKtmP48miBpiaz5nZ/ySjwxPh+2KfjPH0+ojp1WY wQdg== X-Gm-Message-State: APzg51CUaWAdvNdcCQ+DadEIS+5OUzRy+DrVbSbFXz0AAng3dox21akK fytrPlEC6p/9hTNkGRqUXPX5IqUJcTbSoA== X-Google-Smtp-Source: ANB0VdYEW7Pf0+8CBC32cnuLtW0uqmLpXxATjtU3zq9Oj4Omlxuqcm10Mh8JT+7tXG1eml9nlo0QQg== X-Received: by 2002:a50:cf42:: with SMTP id d2-v6mr29862205edk.242.1535993706487; Mon, 03 Sep 2018 09:55:06 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id u53-v6sm12777790edm.51.2018.09.03.09.55.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 09:55:05 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 14/14] drm/vmwgfx: Add FIXME comments for customer page_flip handlers Date: Mon, 3 Sep 2018 18:54:39 +0200 Message-Id: <20180903165439.24845-14-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165439.24845-1-daniel.vetter@ffwll.ch> References: <20180903165439.24845-1-daniel.vetter@ffwll.ch> 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: Thomas Hellstrom , Daniel Vetter , Intel Graphics Development , VMware Graphics , Daniel Vetter MIME-Version: 1.0 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 4c68ad6f3605..8e692334c3b9 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 f5b2fe8a7793..1913e086d015 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;