Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: daniel.vetter@ffwll.ch,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	dri-devel@lists.freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	airlied@gmail.com
Subject: [PATCH 4/6] drm/xe/display: Avoid calling readq()
Date: Thu, 21 Dec 2023 14:28:07 -0800	[thread overview]
Message-ID: <20231221222809.4123220-5-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20231221222809.4123220-1-lucas.demarchi@intel.com>

readq() is not available in 32bits. iosys-map already has the logic in
place to use read u64 in all cases, so simply add a helper variable for
using that.

Fixes: 44e694958b95 ("drm/xe/display: Implement display support")
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 .../gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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 5f19550cc845..6739dadaf1a9 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
@@ -7,6 +7,7 @@
 #define _I915_GEM_OBJECT_H_
 
 #include <linux/types.h>
+#include <linux/iosys-map.h>
 
 #include "xe_bo.h"
 
@@ -36,6 +37,7 @@ static inline int i915_gem_object_read_from_page(struct xe_bo *bo,
 {
 	struct ttm_bo_kmap_obj map;
 	void *virtual;
+	struct iosys_map vaddr;
 	bool is_iomem;
 	int ret;
 
@@ -52,10 +54,11 @@ static inline int i915_gem_object_read_from_page(struct xe_bo *bo,
 	ofs &= ~PAGE_MASK;
 	virtual = ttm_kmap_obj_virtual(&map, &is_iomem);
 	if (is_iomem)
-		*ptr = readq((void __iomem *)(virtual + ofs));
+		iosys_map_set_vaddr_iomem(&vaddr, (void __iomem *)(virtual));
 	else
-		*ptr = *(u64 *)(virtual + ofs);
+		iosys_map_set_vaddr(&vaddr, virtual);
 
+	*ptr = iosys_map_rd(&vaddr, ofs, u64);
 	ttm_bo_kunmap(&map);
 out_unlock:
 	xe_bo_unlock(bo);
-- 
2.40.1


  parent reply	other threads:[~2023-12-21 22:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 22:28 [PATCH 0/6] drm/xe: Fix 32bit build Lucas De Marchi
2023-12-21 22:28 ` [PATCH 1/6] drm/xe: Disable 32bits build Lucas De Marchi
2023-12-22  0:07   ` Rodrigo Vivi
2023-12-21 22:28 ` [PATCH 2/6] drm/xe: Use _ULL for u64 division Lucas De Marchi
2023-12-21 22:28 ` [PATCH 3/6] drm/xe/mmio: Cast to u64 when printing Lucas De Marchi
2023-12-21 22:28 ` Lucas De Marchi [this message]
2023-12-21 22:28 ` [PATCH 5/6] drm/xe: Fix cast on trace variable Lucas De Marchi
2023-12-21 22:28 ` [PATCH 6/6] drm/xe: Enable 32bits build Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231221222809.4123220-5-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=airlied@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox