From patchwork Tue Jan 29 16:45:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10786589 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 E2B8C1390 for ; Tue, 29 Jan 2019 16:45:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D16542C593 for ; Tue, 29 Jan 2019 16:45:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C29E92D462; Tue, 29 Jan 2019 16:45:49 +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 5F19F2C593 for ; Tue, 29 Jan 2019 16:45:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03BDA6E8C9; Tue, 29 Jan 2019 16:45:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc44.google.com (mail-yw1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 25CB56E8C9 for ; Tue, 29 Jan 2019 16:45:45 +0000 (UTC) Received: by mail-yw1-xc44.google.com with SMTP id i73so8441471ywg.3 for ; Tue, 29 Jan 2019 08:45:45 -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=fKsmPEpaEdGyQgxZeB5JbICl/Z+g+/fLxwKgdnnLqc4=; b=OBCchkmE9fxIGnCjbK4NR0gMP2Fej91TmMobJA2c5aXPlprW3oenpHck+pQo8PfsU+ XmDfDT5ASogbgt1OKYpQylbzuVsoZKxzVhMEWhnCQx/01pQEbW2W79Bepn0Vhl0xIQEL Ix2Ce2JBbRe/TOBRqfNwwxfdGfW6Eke6N7oAFebp+WJqJmOTuptoAOSJjbNPdluLwSPm 8u0cVwVPhTO0jjYMWJLZ3JpKsIC7WeAw3TibvqBfOCkU2pUP/UskSJ/EhWq+/wjwI5ml CtW9XTul7VSvizJlu2zRumVjL1h0KXvBKB7Ns3iAps103toMRmWQoUG4wzGPgBoB7igo PPbw== X-Gm-Message-State: AJcUukdDxEYhTznQK7k6bEeb6b3+OHHXCPEXz8vZaeLYMy2AxiQE+EUs fX9bRmGCtkChX15pggUkHqga6MytRMuOMA== X-Google-Smtp-Source: ALg8bN6OsjbpfxdQnlH659QMiFmTiiEm01eSpZ52tyRpXj05LqK306zc4aHlXYmEjluOzvOqQwswCw== X-Received: by 2002:a0d:e505:: with SMTP id o5mr26001656ywe.38.1548780343659; Tue, 29 Jan 2019 08:45:43 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id y16sm12807983ywg.35.2019.01.29.08.45.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 08:45:42 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/TODO: Add vrefresh replacement to the todo Date: Tue, 29 Jan 2019 11:45:10 -0500 Message-Id: <20190129164542.252814-1-sean@poorly.run> X-Mailer: git-send-email 2.20.1.495.gaa96b0ce6b-goog In-Reply-To: <20190129163544.GE20097@intel.com> References: <20190129163544.GE20097@intel.com> 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, David Airlie , Sean Paul , Maxime Ripard , Sean Paul , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul Changes in v2: - Add drm_display_mode.vrefresh removal (Ville) - Add Sam's R-b and bonus points Cc: Ville Syrjälä Suggested-by: Daniel Vetter Reviewed-by: Sam Ravnborg Bonus-points-awarded-by: Sam Ravnborg Signed-off-by: Sean Paul Reviewed-by: Daniel Vetter --- Documentation/gpu/todo.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 38360ede12215..1bbfc5e1b2a46 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -262,6 +262,24 @@ 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, consider removing vrefresh +from drm_display_mode to avoid future use. + +Contact: Sean Paul + Core refactorings =================