From patchwork Tue Sep 19 19:44:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juha-Pekka Heikkila X-Patchwork-Id: 9960051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CD5D96056D for ; Tue, 19 Sep 2017 19:45:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE8C728EB0 for ; Tue, 19 Sep 2017 19:45:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B37DB28EC4; Tue, 19 Sep 2017 19:45:17 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 EE04F28EE6 for ; Tue, 19 Sep 2017 19:45:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 240F06E63B; Tue, 19 Sep 2017 19:44:26 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE89D6E63B for ; Tue, 19 Sep 2017 19:44:23 +0000 (UTC) Received: by mail-lf0-x242.google.com with SMTP id h80so324452lfe.1 for ; Tue, 19 Sep 2017 12:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=asfEdbIFP3Al+ezoEIQjdkwbTJzjhT73DH7CyzrQ8F4=; b=SvTt+CvOAkRhUSEjKQQcisB4qJ67zwOtLEjf32JZkfkkrj0LhVXMDZA0Np59vSrkMg znCpbzaJwtcPknqVFulc3K067CIBPxGTXQGnLU2qmLRLy86f7TXvljz1j5i3hfijBpmY Zge/3YYRnbkKdQ2HBpOfi+ZNtKqdvtFVEIaYVFM3PwgrrnG4shHIOaNx05xuwzIpACMJ P1oyjOGlrcMB7c0j/EhYELNzWiGe6aTATxM+rJCITUtZ/nRL2PJna+pMmt/g0+SLqAez bIP3S7fLu3kgIs30sKC+AYovEtDd1N+PWv5bFmZDbquNLQV0Dml0h5hHEo+6eY+UvW4L JYmg== 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; bh=asfEdbIFP3Al+ezoEIQjdkwbTJzjhT73DH7CyzrQ8F4=; b=tq9M978utP5dNM0AcCbnLslOcGBcrW82Tcs6lpNIdta8DDdDIQHQh9bjpzHgwKr+rf x40W4y9BO6JzUEZyQGSjTtyiAj0mTBmVBdqtkYEUHUG/IN6sYXfCD2Lrv3n3skwWr1tq yf06RjkPTVfDZeR6vFu/u/NtmsG46cHH+SAVYHQwJOIqXZDi+SYqCoeutWI7d+y79ZZf Ar+cGCgFDf1AlqVKFI+8XDLo9/2OxIMelFtPxcFG6wHGgeJkNRux6M+M3WpR0QDjECA+ bWJTXlQNL5/DbuLpIKutOTmAN3WPNNb5P/HyGQmbDbzoSsxRLbHjRfW8nBZkxRU97ttR QBow== X-Gm-Message-State: AHPjjUgHG2oh7M7EoGd3WG3qVzTfeloGCFaeCbIYh+0Rnt+TUaw5YAfl XzRy3ucz+lq3Kts7BYLXU7e8Woo5 X-Google-Smtp-Source: AOwi7QAJtsNmBtlSCMPaJFH7pznDk9Teu3OwFWk0JA03fwd1O0+e22RuJaMVyast24r3i1HFJKekUg== X-Received: by 10.25.17.42 with SMTP id g42mr997956lfi.183.1505850261386; Tue, 19 Sep 2017 12:44:21 -0700 (PDT) Received: from localhost.localdomain (mobile-access-5d6aa2-75.dhcp.inet.fi. [93.106.162.75]) by smtp.gmail.com with ESMTPSA id g83sm22657lji.65.2017.09.19.12.44.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Sep 2017 12:44:20 -0700 (PDT) From: Juha-Pekka Heikkila To: intel-gfx@lists.freedesktop.org Date: Tue, 19 Sep 2017 22:44:09 +0300 Message-Id: <1505850249-23527-6-git-send-email-juhapekka.heikkila@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505850249-23527-1-git-send-email-juhapekka.heikkila@gmail.com> References: <1505850249-23527-1-git-send-email-juhapekka.heikkila@gmail.com> Subject: [Intel-gfx] [PATCH 5/5] drm/i915: adjust get_crtc_fence_y_offset() to use base.y instead of crtc.y X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This is to use clipped y coordinate here. I left get_crtc_fence_y_offset() function itself in place as oneliner to maintain comment above it why this is done. Signed-off-by: Juha-Pekka Heikkila --- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_fbc.c | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 17960ba..f7c1162 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1103,6 +1103,8 @@ struct intel_fbc { */ int adjusted_x; int adjusted_y; + + int base_y; } plane; struct { diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c index dc059808..a65af80 100644 --- a/drivers/gpu/drm/i915/intel_fbc.c +++ b/drivers/gpu/drm/i915/intel_fbc.c @@ -69,12 +69,10 @@ static inline bool no_fbc_on_multiple_pipes(struct drm_i915_private *dev_priv) * address we program because it starts at the real start of the buffer, so we * have to take this into consideration here. */ -static unsigned int get_crtc_fence_y_offset(struct intel_crtc *crtc) +static unsigned int get_crtc_fence_y_offset(struct intel_fbc *fbc) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); - struct intel_fbc *fbc = &dev_priv->fbc; - - return crtc->base.y - fbc->state_cache.plane.adjusted_y; + return fbc->state_cache.plane.base_y + - fbc->state_cache.plane.adjusted_y; } /* @@ -762,6 +760,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, cache->plane.visible = plane_state->base.visible; cache->plane.adjusted_x = plane_state->main.x; cache->plane.adjusted_y = plane_state->main.y; + cache->plane.base_y = plane_state->base.src.y1 >> 16; if (!cache->plane.visible) return; @@ -893,7 +892,7 @@ static void intel_fbc_get_reg_params(struct intel_crtc *crtc, params->crtc.pipe = crtc->pipe; params->crtc.plane = crtc->plane; - params->crtc.fence_y_offset = get_crtc_fence_y_offset(crtc); + params->crtc.fence_y_offset = get_crtc_fence_y_offset(fbc); params->fb.format = cache->fb.format; params->fb.stride = cache->fb.stride;