From patchwork Tue Oct 17 20:08:07 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: 10012805 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 49BC660235 for ; Tue, 17 Oct 2017 20:08:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C36A28A13 for ; Tue, 17 Oct 2017 20:08:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3117028A15; Tue, 17 Oct 2017 20:08: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=-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 D9E9928A13 for ; Tue, 17 Oct 2017 20:08:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15C686E73C; Tue, 17 Oct 2017 20:08:26 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6A8686E736 for ; Tue, 17 Oct 2017 20:08:20 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id u5so2911154wrc.5 for ; Tue, 17 Oct 2017 13:08:20 -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=euNYoo+ZbvM4GuVCk+FJ4m/mCAxXSZo2qKmN9gvm6D8=; b=Pw8+xPzi/JMWDbh29hFDftRPurgVGVCoQ+Q0EnhUmLBcTC6UHpHlVhQnDmLXd5V7HR 3RAMMOkiEyENJlPHc/UNEXKSWnpVFJozdBdpCQPTruJk6/TDiOTKyudPow45JWw53+sQ 1U/ju70Kp9MK98ItJXLELBl3bUUqH+7sxh9Oy1fFFvzUD8kM6yrCTsi/BEX3fTt5t/eq /ZEIo7Vaz7vr1ZE6WlqGDt2CV7W0v/4TCdX+hM9SCUcc4v1zEG+xtM7TT+5p7cI4HbKZ g5L8NeZhvojPf7a9/0kQnOE+/6qshInm/YVEGhtxfEdn5f89IZYmL0slvIGdDh1o2yxX WGjQ== 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=euNYoo+ZbvM4GuVCk+FJ4m/mCAxXSZo2qKmN9gvm6D8=; b=foaYELVypkwNwllBTLMiqWjmI0wDKLCkTCDNqBEBNusClsIW2m4jhv1ATk+HwfSqpA AbSNKt/RvWkpTKibepa4ZW1U9p6Q8vViS35H9abYxyMeDaq6+y8gw4V+Z8cWoun83jaG BTEbawiy/eLDCwe6i4GAS1OXMuSZPNEmmEAUQVbnrMPZrX93gWS36ZGtDLQj0HECFUOv N8UzAFWknrElobIfXMbB49HmeYOdBv9Nfg8Ufau34hQ6WPZOTB6wIF5R2RPS3g8Cr65G f2Vsb9XRMd4mGQSenzYuquFTv4iRZQz0/GTbXI73EhEDoFO7yc9+I+Tj7nFfJaAiGSus S0Aw== X-Gm-Message-State: AMCzsaUdWqSWMFInlbIzAHuks8mC+AHRZaU7z7s9qKqh70F+Gv7nQrFj 33qYjv7UXcpuyg1YPHuQocI66Q== X-Google-Smtp-Source: ABhQp+SPdRksK+kjaFdEVlLUKsNX4tfgokw9bXGzH32uKtimjmHi/Pm4bV84C47OxaHShQpdSUthzg== X-Received: by 10.223.185.41 with SMTP id k38mr4981735wrf.257.1508270898594; Tue, 17 Oct 2017 13:08:18 -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.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Oct 2017 13:08:18 -0700 (PDT) From: Juha-Pekka Heikkila To: intel-gfx@lists.freedesktop.org Date: Tue, 17 Oct 2017 23:08:07 +0300 Message-Id: <1508270891-22186-2-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 1/5] drm/i915: move adjusted_x/y from crtc to cache. 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 Signed-off-by: Juha-Pekka Heikkila --- drivers/gpu/drm/i915/i915_drv.h | 8 ++++++++ drivers/gpu/drm/i915/intel_display.c | 6 ------ drivers/gpu/drm/i915/intel_drv.h | 2 -- drivers/gpu/drm/i915/intel_fbc.c | 11 ++++++++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index dd141b2..93046b0 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1108,6 +1108,14 @@ struct intel_fbc { int src_w; int src_h; bool visible; + /* + * Display surface base address adjustement for + * pageflips. Note that on gen4+ this only adjusts up + * to a tile, offsets within a tile are handled in + * the hw itself (with the TILEOFF register). + */ + int adjusted_x; + int adjusted_y; } plane; struct { diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 17a9a57..ccbc7ff 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3306,9 +3306,6 @@ static void i9xx_update_primary_plane(struct intel_plane *primary, else crtc->dspaddr_offset = linear_offset; - crtc->adjusted_x = x; - crtc->adjusted_y = y; - spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); if (INTEL_GEN(dev_priv) < 4) { @@ -3577,9 +3574,6 @@ static void skylake_update_primary_plane(struct intel_plane *plane, crtc->dspaddr_offset = surf_addr; - crtc->adjusted_x = src_x; - crtc->adjusted_y = src_y; - spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); if (IS_GEMINILAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) { diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 8296df5..298986f 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -812,8 +812,6 @@ struct intel_crtc { * gen4+ this only adjusts up to a tile, offsets within a tile are * handled in the hw itself (with the TILEOFF register). */ u32 dspaddr_offset; - int adjusted_x; - int adjusted_y; struct intel_crtc_state *config; diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c index 8e3a055..0ee65be 100644 --- a/drivers/gpu/drm/i915/intel_fbc.c +++ b/drivers/gpu/drm/i915/intel_fbc.c @@ -71,7 +71,10 @@ static inline bool no_fbc_on_multiple_pipes(struct drm_i915_private *dev_priv) */ static unsigned int get_crtc_fence_y_offset(struct intel_crtc *crtc) { - return crtc->base.y - crtc->adjusted_y; + 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; } /* @@ -727,8 +730,8 @@ static bool intel_fbc_hw_tracking_covers_screen(struct intel_crtc *crtc) intel_fbc_get_plane_source_size(&fbc->state_cache, &effective_w, &effective_h); - effective_w += crtc->adjusted_x; - effective_h += crtc->adjusted_y; + effective_w += fbc->state_cache.plane.adjusted_x; + effective_h += fbc->state_cache.plane.adjusted_y; return effective_w <= max_w && effective_h <= max_h; } @@ -757,6 +760,8 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, cache->plane.src_w = drm_rect_width(&plane_state->base.src) >> 16; cache->plane.src_h = drm_rect_height(&plane_state->base.src) >> 16; cache->plane.visible = plane_state->base.visible; + cache->plane.adjusted_x = plane_state->main.x; + cache->plane.adjusted_y = plane_state->main.y; if (!cache->plane.visible) return;