From patchwork Thu Oct 12 07:21:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13418443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02EFDCDB46E for ; Thu, 12 Oct 2023 07:22:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4963710E06E; Thu, 12 Oct 2023 07:22:18 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id D459210E423 for ; Thu, 12 Oct 2023 07:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697095333; x=1728631333; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dRjfnynpDVkg8z9zzMkel30UR7zGGgmrF8s35IDv1bI=; b=e9SLdtbdMmyAGfd+JHvPzqDka+XTXlYA47lkx5vSf6q0YnZDoESvpH+c PmaXiHCaPxHtVVGJ/FuFtklG048lrf4V7pD/8HRxD0BIo/zgElNs0foOr TlgGghpNj59ZlSXTvjsYBtc0otdwCGwAolQDOFqw+PRI8xMwbOViwZemu IoyLkRsKSz4H3h/L7O3/Y8uHKoUvj2J+ZAZpdFhGS1+wUuF/+yNomjQT+ 8cpSWpFLDrR0VBhx40+waGdi1+zZWm4s43IPnzXX9QiSXTwqe1JuAAfBz cYdIGnDkO7EMa9U9Kd5cip9zqMrsK8PWwZyH/4w1MbNuxSDkTgp0mTCVz g==; X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="471109096" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="471109096" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 00:22:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="897976723" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="897976723" Received: from sidorovd-mobl2.ger.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.252.58.103]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 00:20:25 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Date: Thu, 12 Oct 2023 10:21:57 +0300 Message-Id: <20231012072158.4115795-2-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231012072158.4115795-1-jouni.hogander@intel.com> References: <20231012072158.4115795-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 1/2] drm/i915/display: Move releasing gem object away from fb tracking X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" As a preparation for Xe we want to remove all i915_gem_object details away from frontbuffer tacking code. Due to this move releasing gem object reference to i915_gem_object_set_frontbuffer. Signed-off-by: Jouni Högander Reviewed-by: Juha-Pekka Heikkila --- drivers/gpu/drm/i915/display/intel_frontbuffer.c | 2 -- drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c index ec46716b2f49..2ea37c0414a9 100644 --- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c +++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c @@ -265,8 +265,6 @@ static void frontbuffer_release(struct kref *ref) spin_unlock(&intel_bo_to_i915(obj)->display.fb_tracking.lock); i915_active_fini(&front->write); - - i915_gem_object_put(obj); kfree_rcu(front, rcu); } diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h index e5e870b6f186..9fbf14867a2a 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h @@ -89,6 +89,7 @@ i915_gem_object_set_frontbuffer(struct drm_i915_gem_object *obj, if (!front) { RCU_INIT_POINTER(obj->frontbuffer, NULL); + drm_gem_object_put(intel_bo_to_drm_bo(obj)); } else if (rcu_access_pointer(obj->frontbuffer)) { cur = rcu_dereference_protected(obj->frontbuffer, true); kref_get(&cur->ref); From patchwork Thu Oct 12 07:21:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jouni_H=C3=B6gander?= X-Patchwork-Id: 13418444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0909CDB482 for ; Thu, 12 Oct 2023 07:22:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9ECA410E426; Thu, 12 Oct 2023 07:22:18 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id AFEB610E426 for ; Thu, 12 Oct 2023 07:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697095335; x=1728631335; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qwA9kzCiivcicnAydtg1lxWFtZkQzQBAk8RSGJLc8YE=; b=bmEcOuIdpiDvq4kKrEcli7a0qb7AXHh3tLHJwmJoCN20JO65HUNmHSln t1VKlsFXKNYiRmnst1zNhuS5GBU+RRb+N3vdH3sFGA72+oWNbybYzr719 q8eDHGoKLN0zxZQedh99SQlbyUwtbPbIfkThiUWjT1OMBYmazGCJrFb57 E2TsUDuvcjkkbNFDcmx76h6SrL3husFcYru7SU8bQCqectCsgu6Wih5b1 l3VFpw3VssgtHHjbC3IieKM0L1WYYAJHTlY7IjZ3kvHSL7WftYUozYTw+ ziW21YYZOmf1l59hL+2fERY+Xz6upudgrQkib02gNjgMGmHyBAIoWjThK g==; X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="471109098" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="471109098" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 00:22:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="897976731" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="897976731" Received: from sidorovd-mobl2.ger.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.252.58.103]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 00:20:26 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Date: Thu, 12 Oct 2023 10:21:58 +0300 Message-Id: <20231012072158.4115795-3-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231012072158.4115795-1-jouni.hogander@intel.com> References: <20231012072158.4115795-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 2/2] drm/i915/display: Use intel_bo_to_drm_bo instead of obj->base X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Xe and i915 objects have differing implementation. Use intel_bo_to_drm_bo instead of obj->base as xe_bo doesn't have base pointer. Signed-off-by: Jouni Högander Reviewed-by: Juha-Pekka Heikkila --- drivers/gpu/drm/i915/display/intel_fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index e7678571b0d7..e1d298efc510 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -1930,10 +1930,10 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb, if (!atomic_read(&front->bits)) return 0; - if (dma_resv_test_signaled(obj->base.resv, dma_resv_usage_rw(false))) + if (dma_resv_test_signaled(intel_bo_to_drm_bo(obj)->resv, dma_resv_usage_rw(false))) goto flush; - ret = dma_resv_get_singleton(obj->base.resv, dma_resv_usage_rw(false), + ret = dma_resv_get_singleton(intel_bo_to_drm_bo(obj)->resv, dma_resv_usage_rw(false), &fence); if (ret || !fence) goto flush;