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 i915: Fail gracefully...



details:   https://anonhg.NetBSD.org/src/rev/cc254a4eccb8
branches:  trunk
changeset: 377380:cc254a4eccb8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jul 09 20:24:06 2023 +0000

description:
i915: Fail gracefully, don't panic, with unsupported ggtt views.

Workaround for part of PR kern/56648.

XXX pullup-10

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r c914931512ce -r cc254a4eccb8 sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c       Sun Jul 09 19:19:40 2023 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c       Sun Jul 09 20:24:06 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_ggtt.c,v 1.15 2021/12/19 12:35:13 riastradh Exp $        */
+/*     $NetBSD: intel_ggtt.c,v 1.16 2023/07/09 20:24:06 riastradh Exp $        */
 
 // SPDX-License-Identifier: MIT
 /*
@@ -6,7 +6,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_ggtt.c,v 1.15 2021/12/19 12:35:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_ggtt.c,v 1.16 2023/07/09 20:24:06 riastradh Exp $");
 
 #include <linux/stop_machine.h>
 
@@ -1772,17 +1772,23 @@ i915_get_ggtt_vma_pages(struct i915_vma 
                vma->pages = vma->obj->mm.pages;
                return 0;
 
-#ifndef __NetBSD__
        case I915_GGTT_VIEW_ROTATED:
+#ifdef __NetBSD__
+               vma->pages = ERR_PTR(-ENODEV);
+#else
                vma->pages =
                        intel_rotate_pages(&vma->ggtt_view.rotated, vma->obj);
+#endif
                break;
 
        case I915_GGTT_VIEW_REMAPPED:
+#ifdef __NetBSD__
+               vma->pages = ERR_PTR(-ENODEV);
+#else
                vma->pages =
                        intel_remap_pages(&vma->ggtt_view.remapped, vma->obj);
+#endif
                break;
-#endif
 
        case I915_GGTT_VIEW_PARTIAL:
                vma->pages = intel_partial_pages(&vma->ggtt_view, vma->obj);



Home | Main Index | Thread Index | Old Index