Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915/gt Bus-space-ify
details: https://anonhg.NetBSD.org/src/rev/2958527887de
branches: trunk
changeset: 1028692:2958527887de
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 11:46:47 2021 +0000
description:
Bus-space-ify
Author: Maya Rashish <maya%NetBSD.org@localhost>
Committer: Taylor R Campbell <riastradh%NetBSD.org@localhost>
diffstat:
sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_types.h | 13 ++---
sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c | 27 ++++++++++++-
2 files changed, 31 insertions(+), 9 deletions(-)
diffs (103 lines):
diff -r e5b6d748c587 -r 2958527887de sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_types.h
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_types.h Sun Dec 19 11:46:38 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_types.h Sun Dec 19 11:46:47 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intel_engine_types.h,v 1.5 2021/12/19 11:13:22 riastradh Exp $ */
+/* $NetBSD: intel_engine_types.h,v 1.6 2021/12/19 11:46:47 riastradh Exp $ */
/*
* SPDX-License-Identifier: MIT
@@ -166,9 +166,11 @@
bool no_priolist;
#ifdef __NetBSD__
-# define __iomem
-#endif
-
+ bus_space_tag_t bst;
+ bus_space_handle_t bsh;
+ bus_size_t submit_reg;
+ bus_size_t ctrl_reg;
+#else
/**
* @submit_reg: gen-specific execlist submission register
* set to the ExecList Submission Port (elsp) register pre-Gen11 and to
@@ -181,9 +183,6 @@
* submit queue on the HW and to request preemptions to idle
*/
u32 __iomem *ctrl_reg;
-
-#ifdef __NetBSD__
-# undef __iomem
#endif
#define EXECLIST_MAX_PORTS 2
diff -r e5b6d748c587 -r 2958527887de sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c Sun Dec 19 11:46:38 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c Sun Dec 19 11:46:47 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intel_lrc.c,v 1.3 2021/12/19 11:37:50 riastradh Exp $ */
+/* $NetBSD: intel_lrc.c,v 1.4 2021/12/19 11:46:47 riastradh Exp $ */
/*
* Copyright © 2014 Intel Corporation
@@ -134,7 +134,7 @@
*
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.3 2021/12/19 11:37:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.4 2021/12/19 11:46:47 riastradh Exp $");
#include <linux/interrupt.h>
@@ -1370,6 +1370,15 @@
static inline void write_desc(struct intel_engine_execlists *execlists, u64 desc, u32 port)
{
+#ifdef __NetBSD__
+ if (execlists->ctrl_reg) {
+ bus_space_write_4(execlists->bst, execlists->bsh, execlists->submit_reg + port * 2, lower_32_bits(desc));
+ bus_space_write_4(execlists->bst, execlists->bsh, execlists->submit_reg + port * 2 + 1, upper_32_bits(desc));
+ } else {
+ bus_space_write_4(execlists->bst, execlists->bsh, execlists->submit_reg, upper_32_bits(desc));
+ bus_space_write_4(execlists->bst, execlists->bsh, execlists->submit_reg, lower_32_bits(desc));
+ }
+#else
if (execlists->ctrl_reg) {
writel(lower_32_bits(desc), execlists->submit_reg + port * 2);
writel(upper_32_bits(desc), execlists->submit_reg + port * 2 + 1);
@@ -1377,6 +1386,7 @@
writel(upper_32_bits(desc), execlists->submit_reg);
writel(lower_32_bits(desc), execlists->submit_reg);
}
+#endif
}
static __maybe_unused void
@@ -4348,13 +4358,26 @@
DRM_ERROR("WA batch buffer initialization failed\n");
if (HAS_LOGICAL_RING_ELSQ(i915)) {
+#ifdef __NetBSD__
+ execlists->submit_reg = i915_mmio_reg_offset(RING_EXECLIST_SQ_CONTENTS(base));
+ execlists->ctrl_reg = i915_mmio_reg_offset(RING_EXECLIST_CONTROL(base));
+ execlists->bsh = uncore->regs_bsh;
+ execlists->bst = uncore->regs_bst;
+#else
execlists->submit_reg = uncore->regs +
i915_mmio_reg_offset(RING_EXECLIST_SQ_CONTENTS(base));
execlists->ctrl_reg = uncore->regs +
i915_mmio_reg_offset(RING_EXECLIST_CONTROL(base));
+#endif
} else {
+#ifdef __NetBSD__
+ execlists->submit_reg = i915_mmio_reg_offset(RING_ELSP(base));
+ execlists->bsh = uncore->regs_bsh;
+ execlists->bst = uncore->regs_bst;
+#else
execlists->submit_reg = uncore->regs +
i915_mmio_reg_offset(RING_ELSP(base));
+#endif
}
execlists->csb_status =
Home |
Main Index |
Thread Index |
Old Index