From mboxrd@z Thu Jan 1 00:00:00 1970 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 44C92C4167B for ; Thu, 7 Dec 2023 13:01:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D32510E89F; Thu, 7 Dec 2023 13:01:12 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3AD2F10E88D for ; Thu, 7 Dec 2023 13:01:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701954068; x=1733490068; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LhLwmn39gn7GTxST43evDVqk0kRqWPRZ4hB64LRWCjA=; b=OspKz8uJgmps9dvAdtmgxrmaJJSConePgtG8KZG7vHWYy+sS0hBBJQ/v 2s33HN29jvj4GzLd7F5nwpY2SMw8vToMZvYkwWn27+JkLE5qV4Vy7RelA fW5seULGEY2r8LEYXoQWNSJ2NG2EHtuvhNRRuyI1gXpgivbhJgLi7kSTg jZQAoNg4E2RO51fkxXLrWRJZ0mqpSzGGDXoLJc6H+ufGMthKjayMREVCT vHE900MyVwjBaekUcWEn3MNz8NF0IfUswgzhEsM94dms4yGh97BgBmnqD 8LTRP36ILpWrwnZyfjC4b52W4Rs61tUUI6fNGuAxNwf4Flxi+PGGgNxGL g==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="1308980" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="1308980" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 05:01:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="721454198" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="721454198" Received: from rlgreyi-mobl.amr.corp.intel.com (HELO jhogande-mobl1.intel.com) ([10.252.46.17]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 05:01:06 -0800 From: =?UTF-8?q?Jouni=20H=C3=B6gander?= To: intel-xe@lists.freedesktop.org Subject: [PATCH v2 4/9] fixup! drm/xe/display: Implement display support Date: Thu, 7 Dec 2023 15:00:41 +0200 Message-Id: <20231207130046.2350822-5-jouni.hogander@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231207130046.2350822-1-jouni.hogander@intel.com> References: <20231207130046.2350822-1-jouni.hogander@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Jouni=20H=C3=B6gander?= Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" We need to add i915_gem_object_read_from_page to build intel_display.c. Signed-off-by: Maarten Lankhorst Signed-off-by: Jouni Högander --- .../compat-i915-headers/gem/i915_gem_object.h | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h index b991069b5cb3..eaab536f465f 100644 --- a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h +++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h @@ -17,4 +17,35 @@ static inline dma_addr_t i915_gem_object_get_dma_address(const struct xe_bo *bo, return n; } +static inline int i915_gem_object_read_from_page(struct xe_bo *bo, + u32 ofs, u64 *ptr, u32 size) +{ + struct ttm_bo_kmap_obj map; + void *virtual; + bool is_iomem; + int ret; + + XE_WARN_ON(size != 8); + + ret = xe_bo_lock(bo, true); + if (ret) + return ret; + + ret = ttm_bo_kmap(&bo->ttm, ofs >> PAGE_SHIFT, 1, &map); + if (ret) + goto out_unlock; + + ofs &= ~PAGE_MASK; + virtual = ttm_kmap_obj_virtual(&map, &is_iomem); + if (is_iomem) + *ptr = readq((void __iomem *)(virtual + ofs)); + else + *ptr = *(u64 *)(virtual + ofs); + + ttm_bo_kunmap(&map); +out_unlock: + xe_bo_unlock(bo); + return ret; +} + #endif -- 2.34.1