From patchwork Tue Jan 29 19:26:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10787139 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 1EA1013B5 for ; Tue, 29 Jan 2019 19:26:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B7A22CCAB for ; Tue, 29 Jan 2019 19:26:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F37852D628; Tue, 29 Jan 2019 19:26:47 +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 89D892CCAB for ; Tue, 29 Jan 2019 19:26:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A443F6E93E; Tue, 29 Jan 2019 19:26:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc43.google.com (mail-yw1-xc43.google.com [IPv6:2607:f8b0:4864:20::c43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E3A06E93E for ; Tue, 29 Jan 2019 19:26:42 +0000 (UTC) Received: by mail-yw1-xc43.google.com with SMTP id t13so8627458ywe.13 for ; Tue, 29 Jan 2019 11:26:42 -0800 (PST) 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=GcukgBXEHQSQGkc3mdvEQKq+keUsB3n7RVA/njAR1oA=; b=hMeKiZrfQX6gBhbbr7w57KK8ZjmvOgdfuCEpfojKcGBhqyrFeZ8BaPYFxvNoKh3xGK bdzglThg/qRxjRBUNmx6T7AHwwzWqrghVXjJOVwVEKyu1vN5bMs+YY6wsc4G+yH+oj+e B/ks2fiNdjAsQyqoI+lKoRxwVkEU1ZMhWzIKGOZCyOqHEdV20KwkEqiU/qD7EygXJCgc ZZBoFCcWSi5rLzzQlKTe5V5D8Jtg5lVGnkDP7TeYzSVCW04Yq29k17MtBBB2s+/02VR8 jP3Q5kmMKlrQsFrMwmm0INFSeNQmbru+GGE40fryHaU/YvbKAkJR2pmb6qCCm8GgLrmj zNHw== X-Gm-Message-State: AJcUukcoibNlbU+TDYLzmcB3MC4Fu8VAftkCJreUm18AVtYlCvRWUWa3 uD2yvzuB7RrJxNfd7b82EWleyd6gZUm8/w== X-Google-Smtp-Source: ALg8bN5YNeI59k7N2Iy5BkOS+1YeIWH0GaXoli7bgrvb7FNHkclAuxK3xT1hHl+yviz6Jkofmge34Q== X-Received: by 2002:a0d:e901:: with SMTP id s1mr24946614ywe.97.1548790000218; Tue, 29 Jan 2019 11:26:40 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id j134sm18130704ywb.91.2019.01.29.11.26.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 11:26:38 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH v3] drm/TODO: Add drm_display_mode.hsync/vrefresh removal Date: Tue, 29 Jan 2019 14:26:29 -0500 Message-Id: <20190129192637.73296-1-sean@poorly.run> X-Mailer: git-send-email 2.20.1.495.gaa96b0ce6b-goog In-Reply-To: <20190129172441.GX3271@phenom.ffwll.local> References: <20190129172441.GX3271@phenom.ffwll.local> 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: linux-doc@vger.kernel.org, Maxime Ripard , Sean Paul , David Airlie , Sean Paul , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul Drivers shouldn't be using these values, add a TODO so someone removes them. Changes in v2: - Add drm_display_mode.vrefresh removal (Ville) - Add Sam's R-b and bonus points Changes in v3: - Add hsync removal todo item (Daniel) - Change vrefresh wording to make removal less optional Cc: Ville Syrjälä Suggested-by: Daniel Vetter Reviewed-by: Daniel Vetter Reviewed-by: Sam Ravnborg Bonus-points-awarded-by: Sam Ravnborg Signed-off-by: Sean Paul --- This time with feeling. Documentation/gpu/todo.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 38360ede12215..f67c84b92873c 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -262,6 +262,34 @@ As a reference, take a look at the conversions already completed in drm core. Contact: Sean Paul, respective driver maintainers +Convert direct mode.vrefresh accesses to use drm_mode_vrefresh() +---------------------------------------------------------------- + +drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it +is risky and has been known to cause div-by-zero bugs. Fortunately, drm core +has helper which will use mode.vrefresh if it's !0 and will calculate it from +the timings when it's 0. + +Use simple search/replace, or (more fun) cocci to replace instances of direct +vrefresh access with a call to the helper. Check out +https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for +inspiration. + +Once all instances of vrefresh have been converted, remove vrefresh from +drm_display_mode to avoid future use. + +Contact: Sean Paul + +Remove drm_display_mode.hsync +----------------------------- + +We have drm_mode_hsync() to calculate this from hsync_start/end, since drivers +shouldn't/don't use this, remove this member to avoid any temptations to use it +in the future. If there is any debug code using drm_display_mode.hsync, convert +it to use drm_mode_hsync() instead. + +Contact: Sean Paul + Core refactorings =================