From patchwork Tue Oct 2 13:35:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10623723 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 D18B015E8 for ; Tue, 2 Oct 2018 13:36:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D28CE28992 for ; Tue, 2 Oct 2018 13:36:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C687C289C0; Tue, 2 Oct 2018 13:36:34 +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=unavailable 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 A59D828992 for ; Tue, 2 Oct 2018 13:36:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D30A96E347; Tue, 2 Oct 2018 13:35:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id CC73C6E337 for ; Tue, 2 Oct 2018 13:35:43 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id a4-v6so2058169eds.10 for ; Tue, 02 Oct 2018 06:35:43 -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=qqt9MifMKLAUL41JC3QiYP63Zs8CQOYkqmdiwK8pOKU=; b=ijiiHsvi3TOzph4on0l1yPWj7SjrBdECmeSA68zalPtBL2Ai5EfH+pqEVnrNgALVkB PJcvEX/4v81NxJ7kikbQuan9Jy9Lby+U9cAnhGrP1ivHPgFn86RV7vWuw1Xh/KfddKYC 2neXjA28AyEgm3rQ1mVgpA4EPskPa3WjU9paZRFmird5unS1edni5wa5+LVOAM48oqit yg/TUTlWUtZ3qFy5gU2GLWTkhGRsabf/MdyG5t151eF1nQhgC/YZWhi1AECLaZHceQjk cviFmCy2pdsfs+Xzea3yvs9QGkhyIQvoHaTbg20DRUwvOfnA3fs9qwIYM0SdHRnCaycJ KAzg== X-Gm-Message-State: ABuFfojj542raLbC4v/pDfF+fIz4NT1XSK5fYw1AsRX/DdfIShRfEHPN zeBRRCbOaiUJzDZii+iIQOU8WjO6fyU= X-Google-Smtp-Source: ACcGV63a3TdusTJQASEek6RrxgwL7TVPqn6tSlyLLEqhqMVevaIoHndS1PeXCRDsDyp7ChxrEKdvKQ== X-Received: by 2002:a50:a908:: with SMTP id l8-v6mr13581727edc.30.1538487342124; Tue, 02 Oct 2018 06:35:42 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id k42-v6sm3118819ede.94.2018.10.02.06.35.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 06:35:41 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 07/18] drm/vmwgfx: Add FIXME comments for customer page_flip handlers Date: Tue, 2 Oct 2018 15:35:15 +0200 Message-Id: <20181002133526.13685-8-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.19.0.rc2 In-Reply-To: <20181002133526.13685-1-daniel.vetter@ffwll.ch> References: <20181002133526.13685-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: Thomas Hellstrom , Daniel Vetter , Intel Graphics Development , 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 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 e28bb08114a5..199927f20e0a 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;