From patchwork Wed May 8 16:09:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10936165 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 8305792A for ; Wed, 8 May 2019 16:09:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FD252811E for ; Wed, 8 May 2019 16:09:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6358D28538; Wed, 8 May 2019 16:09:27 +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 EC3222811E for ; Wed, 8 May 2019 16:09:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 404F2897D0; Wed, 8 May 2019 16:09:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by gabe.freedesktop.org (Postfix) with ESMTPS id A2FFD897D0 for ; Wed, 8 May 2019 16:09:23 +0000 (UTC) Received: by mail-qt1-x829.google.com with SMTP id t1so3623136qtc.12 for ; Wed, 08 May 2019 09:09:23 -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:mime-version :content-transfer-encoding; bh=ZuA1H8/bCgJfsPaV3bxQ5r2Gm40gimxvB9w8idYsqQI=; b=HYxVGkDcq4aAD9g7GgwO09cKhnl9XknOB4yyLhWC9+Z8YH2d9pQZOacoK3rIjJV3f0 YGa2YwtK6eRz1XKMAOSkc0FndFG+wE/OznFR9XemrzlkAlYJ4we8SqMnKuFOSzIEedAV XDwSyrOA96pjlrBJv+HIHvvq/8HZSGgtg/5ayfI5rAvo/QzCK5mxqJ/E4wE9zoh5H7up k1zjTE8JHFJ+jaf1ivYll+/oxU/CzEuB5i9/jDUjovU2KgtPIEqH+4ej3HgwtlsPXrGr W/LYT8o/Y6UH9zGRYQ7tVZcd0NIQpHREcLb88H4O9cDGOq7GJ0uVkMWCyZM55Gj+a44R jp5w== X-Gm-Message-State: APjAAAX+yYUhI7ukTkA2bO6w5WNt6Q/Y7/B3c9LE64M2igO1vJ+SW1xY ZRacIrz1ZgrU/exAtIIAi8slYsOvDD4= X-Google-Smtp-Source: APXvYqzRnz7EQiULGOm1m8ROTRo2G3xvatY3G+3s2B42th8pRKNOPuD2ObQ9GTkBoNHT3uA2vhvmGg== X-Received: by 2002:a0c:ff0b:: with SMTP id w11mr31366785qvt.33.1557331762284; Wed, 08 May 2019 09:09:22 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id s50sm10936877qts.39.2019.05.08.09.09.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2019 09:09:21 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH v4 00/12] drm: Add self refresh helpers Date: Wed, 8 May 2019 12:09:05 -0400 Message-Id: <20190508160920.144739-1-sean@poorly.run> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZuA1H8/bCgJfsPaV3bxQ5r2Gm40gimxvB9w8idYsqQI=; b=VXFYNvwgLwsknF95z8T35E5bCPHoUyLgYUlH+euafYU3MjzewZ55AaZsQeYW9OPZOW X8iJYuaK58fPAJ7/6KLqRAvPhvOPs26lPS6jqo15GhP7D35kSYaTggVBJB9Ee+K/fpwK W0ibK9QJ8y+AUSivXljus+V5BlaAI0T53/cULk6iTYntfMKY9hynFZVBmhmh4VXKRMFG NQT8W1PGmzVsSmnknh7+CWOq0wt1oYUghzfCysp0DniVEvu1ugtFcGkDl1+odA40QCPA VcYrEj0cCqYIvK7Ukgd2tW6qU4l4vpsbfT/lHgUmMXmJThDLBbhdduEjZgbbcB0Iacw4 bcpg== 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: Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul Another version of the SR helpers for your consumption. Pretty minor differences between v4 and v3: - lots of documentation changes - Use connector to get at crtc state in encoders - Use the damage helpers in rockchip to fix fbdev Note that the rockchip patches require e9abc611a941d4051cde1d94b2ab7473fdb50102 which is making its way through the -fixes branches. PTAL Laurent Pinchart (1): drm: Add drm_atomic_get_(old|new-_connector_for_encoder() helpers Sean Paul (10): drm: Add atomic variants of enable/disable to encoder helper funcs drm: Add atomic variants for bridge enable/disable drm: Convert connector_helper_funcs->atomic_check to accept drm_atomic_state drm: Add helpers to kick off self refresh mode in drivers drm/rockchip: Use dirtyfb helper drm/rockchip: Check for fast link training before enabling psr drm/rockchip: Use the helpers for PSR drm/rockchip: Use vop_win in vop_win_disable instead of vop_win_data drm/rockchip: Don't fully disable vop on self refresh drm/rockchip: Use drm_atomic_helper_commit_tail_rpm Documentation/gpu/drm-kms-helpers.rst | 9 + drivers/gpu/drm/Makefile | 2 +- .../drm/bridge/analogix/analogix_dp_core.c | 292 +++++++++++++----- .../drm/bridge/analogix/analogix_dp_core.h | 2 +- drivers/gpu/drm/drm_atomic.c | 72 +++++ drivers/gpu/drm/drm_atomic_helper.c | 55 +++- drivers/gpu/drm/drm_atomic_state_helper.c | 4 + drivers/gpu/drm/drm_atomic_uapi.c | 7 +- drivers/gpu/drm/drm_bridge.c | 110 +++++++ drivers/gpu/drm/drm_self_refresh_helper.c | 213 +++++++++++++ drivers/gpu/drm/i915/intel_atomic.c | 8 +- drivers/gpu/drm/i915/intel_dp_mst.c | 7 +- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_sdvo.c | 9 +- drivers/gpu/drm/i915/intel_tv.c | 8 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 5 +- drivers/gpu/drm/rcar-du/rcar_lvds.c | 12 +- drivers/gpu/drm/rockchip/Makefile | 3 +- .../gpu/drm/rockchip/analogix_dp-rockchip.c | 106 ++++--- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 39 +-- drivers/gpu/drm/rockchip/rockchip_drm_psr.c | 290 ----------------- drivers/gpu/drm/rockchip/rockchip_drm_psr.h | 30 -- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 84 ++++- drivers/gpu/drm/vc4/vc4_txp.c | 7 +- include/drm/bridge/analogix_dp.h | 4 - include/drm/drm_atomic.h | 22 ++ include/drm/drm_bridge.h | 106 +++++++ include/drm/drm_connector.h | 14 + include/drm/drm_crtc.h | 19 ++ include/drm/drm_modeset_helper_vtables.h | 50 ++- include/drm/drm_self_refresh_helper.h | 22 ++ 31 files changed, 1062 insertions(+), 551 deletions(-) create mode 100644 drivers/gpu/drm/drm_self_refresh_helper.c delete mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_psr.c delete mode 100644 drivers/gpu/drm/rockchip/rockchip_drm_psr.h create mode 100644 include/drm/drm_self_refresh_helper.h Tested-by: Heiko Stuebner