From patchwork Tue Oct 17 20:08:11 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: 10012809 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 056F160235 for ; Tue, 17 Oct 2017 20:08:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC25F28A13 for ; Tue, 17 Oct 2017 20:08:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E10CE28A15; Tue, 17 Oct 2017 20:08:31 +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 A159B28A13 for ; Tue, 17 Oct 2017 20:08:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEA406E748; Tue, 17 Oct 2017 20:08:30 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 615D26E736 for ; Tue, 17 Oct 2017 20:08:24 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id j14so2910380wre.8 for ; Tue, 17 Oct 2017 13:08:24 -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=V7Bbx3jcDERPpm/p41PosnigrEjL+yG1zjXGWVb/egA=; b=G32J2ik4IaDP85FPxWJuBCoLBHpGTQ1CKX14WICCJvuIQuYwcqLthGYkQg4pOWu7H0 Eh42iaFioMwUQVb/U1YZ323EeOJdON4Llh2r5aM3Njju2AL1X3SDOvUiQ71Iy/Ia3fME 20iQiuACUmrXGvzZppcQ0fEfSTHF8hS9ttm0mGwxzP3fTi5z7hbjirBfM59t3N4AYPVp 3DIarMIWmtjq8r4W/uwtK0LkiFN2QSo7wSO5QA6qSPbO6mmfcM5P2jQ0oU+d+7/8mRZ2 m9JYGmQadvGkQgT6y0kn/83qGtmrvvHpGTzBwiZPa21oIGA5IKlVyTnEc2pczzDfBPFJ tzlg== 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=V7Bbx3jcDERPpm/p41PosnigrEjL+yG1zjXGWVb/egA=; b=sBFpee5QDETcH1yy8pyANWJnk8/7Kllbjd6wwjSeAWGynWxNM4NP+z29ZkWdSsJGGK xLNsws4eYiSqDDLPm+7xfvZJ3O9b5fUpEvlcKlYve+XWJqSL3TFIQAL/IrGKvO+lgb8Z e/GOfwBZUD9bqLkwQ4BwxbPjL9TLV2xfN+V7rccjP8R0iFEoEqDhqJqh8EGzuTWIB/DK Th30B2CsIaxcuhhCUVKdfPF8Z/EUQWgzoFUi39VwB/Eo2gq7hdtl5mAOz18My1ivmoZu hruffSr9IrttM/9f8XVsFx4RYX+XSG5wYz3LvVeG3m8m0GU3WvWavvPKA1RJDf5gqnjk D9XQ== X-Gm-Message-State: AMCzsaV0sCqhA9YczV0wi5VFLsxYipGj366jKSEYXhrlEt+R2/8k2bvU Lf2B8nXOuNeGLrPZq1cH3Y724w== X-Google-Smtp-Source: ABhQp+Qf6XmXzUIa6K8HtJ30CHso4n/8eo4eOY0wt33dNeFP6GlLRR7iY53O2xw8+x/o+9KTCFutLw== X-Received: by 10.223.130.20 with SMTP id 20mr4513853wrb.216.1508270902777; Tue, 17 Oct 2017 13:08:22 -0700 (PDT) Received: from localhost.localdomain (77-105-101-149.lpok.fi. [77.105.101.149]) by smtp.gmail.com with ESMTPSA id r63sm14595562wmg.13.2017.10.17.13.08.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Oct 2017 13:08:22 -0700 (PDT) From: Juha-Pekka Heikkila To: intel-gfx@lists.freedesktop.org Date: Tue, 17 Oct 2017 23:08:11 +0300 Message-Id: <1508270891-22186-6-git-send-email-juhapekka.heikkila@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508270891-22186-1-git-send-email-juhapekka.heikkila@gmail.com> References: <1508270891-22186-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 | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 93046b0..809bacf 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1116,6 +1116,8 @@ struct intel_fbc { */ int adjusted_x; int adjusted_y; + + int y; } plane; struct { diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c index 0ee65be..1a0f5e0 100644 --- a/drivers/gpu/drm/i915/intel_fbc.c +++ b/drivers/gpu/drm/i915/intel_fbc.c @@ -69,12 +69,9 @@ 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.y - fbc->state_cache.plane.adjusted_y; } /* @@ -762,6 +759,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.y = plane_state->base.src.y1 >> 16; if (!cache->plane.visible) return; @@ -893,7 +891,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;