From patchwork Wed Sep 30 07:05:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1374152 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C1S2V6tZJz9sTv; Wed, 30 Sep 2020 17:05:38 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1kNWBD-00039a-CK; Wed, 30 Sep 2020 07:05:35 +0000 Received: from mail-pl1-f195.google.com ([209.85.214.195]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kNWBB-00038F-8S for kernel-team@lists.ubuntu.com; Wed, 30 Sep 2020 07:05:33 +0000 Received: by mail-pl1-f195.google.com with SMTP id m15so447994pls.8 for ; Wed, 30 Sep 2020 00:05:32 -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:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=65PCfK/pkuYr2iGJPkX6RPLx/eS06Pup5KCcjFr83AY=; b=lIGTUy2mmGbQMtH5ClMRAuFXv83bptUn6WnV9UsA1QuHQfWTRoY4nAEJ5wX82Nlii0 nfren9VSGp1cTXtInIBRq4nLL4K2HTCioOJEFIaIRKNhC4i2kCTddxiODHSwSs9SwQps oiQAHFkgVXM3OqvXj1VWo50xR+w1Ni6CeN1ppNLFybHaf0FNfcSLjNVtM+7h1hhCJsXX SL2JtliowyqOsVfNbTIFg49JI0Gpii5VFiu8L70PQ6YyWwmieDfLLWxLmFRznMzUw2gQ FdfnXNUO5+HYneB8HpUezcB55vEcsQUBGHWoOvfP7tzCvLwGnA8lcdJl+N1QmltQbw3G cO2w== X-Gm-Message-State: AOAM530dlQs+v/kRTOZU68DxsYKA/sTldMgCBZgpJQhnZVPNYhgKtlOJ H6ULs1XNRifCe3HQGlRH6yHvcHupuC9+Yg== X-Google-Smtp-Source: ABdhPJxKjLf/KqfDuB/WtNt7yYjonpqrLHMovX8xLQPWF7zsDHnm5YaY6ta7AWwIvkNhE3pkiAaGdQ== X-Received: by 2002:a17:90b:1b03:: with SMTP id nu3mr1312291pjb.148.1601449530562; Wed, 30 Sep 2020 00:05:30 -0700 (PDT) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id d193sm1083480pfd.181.2020.09.30.00.05.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2020 00:05:29 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 1/2][SRU][U] UBUNTU: SAUCE: drm/i915/psr: allow overriding PSR disable param by quirk Date: Wed, 30 Sep 2020 15:05:14 +0800 Message-Id: <20200930070515.711477-5-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200930070515.711477-1-vicamo.yang@canonical.com> References: <20200930070515.711477-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.195; envelope-from=vicamo@gmail.com; helo=mail-pl1-f195.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1897501 HP ZBook Studio G7 equips an INX FHD N156HCG-GQ1 panel that renders corrupted screen when PSR is disabled. This patch allows overriding the default disabled i915_modparams.enable_psr since LP: #1849947 to use chip default when a EDID match is on. Signed-off-by: You-Sheng Yang --- drivers/gpu/drm/i915/display/intel_psr.c | 8 ++++++++ include/drm/drm_dp_helper.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index bf9e320c547d..215ecd999d1d 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1500,6 +1500,14 @@ void intel_psr_init(struct drm_i915_private *dev_priv) */ dev_priv->hsw_psr_mmio_adjust = _SRD_CTL_EDP - _HSW_EDP_PSR_BASE; + /* + * PSR was disabled by module parameters but the underlying panel is + * depending on it, so use per-chip default to probe that automatically. + */ + if ((dev_priv->psr.dp->edid_quirks & BIT(DP_QUIRK_FORCE_PSR_CHIP_DEFAULT)) && + dev_priv->params.enable_psr == 0) + dev_priv->params.enable_psr = -1; + if (dev_priv->params.enable_psr == -1) if (INTEL_GEN(dev_priv) < 9 || !dev_priv->vbt.psr.enable) dev_priv->params.enable_psr = 0; diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index e47dc22ebf50..933a37b29ead 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1705,6 +1705,14 @@ enum drm_dp_quirk { * the DP_MAX_LINK_RATE register reporting a lower max multiplier. */ DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS, + /** + * @DP_QUIRK_FORCE_PSR_CHIP_DEFAULT + * + * PSR was disabled by default in Ubuntu 5.0 kernels and on, but some + * platforms might be depending on them. If so, use per-chip default to + * probe that automatically. + */ + DP_QUIRK_FORCE_PSR_CHIP_DEFAULT, }; /**