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 i915: Omit more unnecess...



details:   https://anonhg.NetBSD.org/src/rev/569f36914a72
branches:  trunk
changeset: 1028896:569f36914a72
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:25:37 2021 +0000

description:
i915: Omit more unnecessary local diffs.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c |  12 ++++----
 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c        |  26 +++---------------
 sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c  |   9 ++---
 sys/external/bsd/drm2/dist/drm/i915/i915_vma.h        |   4 +-
 4 files changed, 17 insertions(+), 34 deletions(-)

diffs (170 lines):

diff -r b35ff9c8b808 -r 569f36914a72 sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c     Sun Dec 19 12:25:27 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c     Sun Dec 19 12:25:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_cmd_parser.c,v 1.27 2021/12/19 11:17:10 riastradh Exp $   */
+/*     $NetBSD: i915_cmd_parser.c,v 1.28 2021/12/19 12:25:37 riastradh Exp $   */
 
 /*
  * Copyright © 2013 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_cmd_parser.c,v 1.27 2021/12/19 11:17:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_cmd_parser.c,v 1.28 2021/12/19 12:25:37 riastradh Exp $");
 
 #include <linux/bitmap.h>
 
@@ -1158,7 +1158,7 @@
                src = i915_gem_object_pin_map(src_obj, I915_MAP_WC);
                if (!IS_ERR(src)) {
                        i915_unaligned_memcpy_from_wc(dst,
-                                                     (char *)src + offset,
+                                                     src + offset,
                                                      length);
                        i915_gem_object_unpin_map(src_obj);
                }
@@ -1192,11 +1192,11 @@
 
                        src = kmap_atomic(i915_gem_object_get_page(src_obj, n));
                        if (needs_clflush)
-                               drm_clflush_virt_range((char *)src + x, len);
-                       memcpy(ptr, (char *)src + x, len);
+                               drm_clflush_virt_range(src + x, len);
+                       memcpy(ptr, src + x, len);
                        kunmap_atomic(src);
 
-                       ptr = (char *)ptr + len;
+                       ptr += len;
                        length -= len;
                        x = 0;
                }
diff -r b35ff9c8b808 -r 569f36914a72 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c    Sun Dec 19 12:25:27 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c    Sun Dec 19 12:25:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem.c,v 1.71 2021/12/19 12:25:27 riastradh Exp $  */
+/*     $NetBSD: i915_gem.c,v 1.72 2021/12/19 12:25:37 riastradh Exp $  */
 
 /*
  * Copyright © 2008-2015 Intel Corporation
@@ -28,23 +28,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.71 2021/12/19 12:25:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.72 2021/12/19 12:25:37 riastradh Exp $");
 
 #ifdef __NetBSD__
-#if 0                          /* XXX uvmhist option?  */
-#include "opt_uvmhist.h"
-#endif
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-#include <uvm/uvm.h>
-#include <uvm/uvm_extern.h>
-#include <uvm/uvm_fault.h>
-#include <uvm/uvm_page.h>
-#include <uvm/uvm_pmap.h>
-#include <uvm/uvm_prot.h>
-
 #include <drm/bus_dma_hacks.h>
 #endif
 
@@ -241,7 +227,7 @@
        int ret;
 
        GEM_BUG_ON(!is_power_of_2(mr->min_page_size));
-       size = round_up(*size_p, mr->min_page_size);
+       size = ALIGN(*size_p, mr->min_page_size);
        if (size == 0)
                return -EINVAL;
 
@@ -269,7 +255,6 @@
                     struct drm_device *dev,
                     struct drm_mode_create_dumb *args)
 {
-
        enum intel_memory_type mem_type;
        int cpp = DIV_ROUND_UP(args->bpp, 8);
        u32 format;
@@ -289,12 +274,12 @@
        }
 
        /* have to work out size/pitch and return them */
-       args->pitch = round_up(args->width * cpp, 64);
+       args->pitch = ALIGN(args->width * cpp, 64);
 
        /* align stride to page size so that we can remap */
        if (args->pitch > intel_plane_fb_max_stride(to_i915(dev), format,
                                                    DRM_FORMAT_MOD_LINEAR))
-               args->pitch = round_up(args->pitch, 4096);
+               args->pitch = ALIGN(args->pitch, 4096);
 
        if (args->pitch < args->width)
                return -EINVAL;
@@ -363,7 +348,6 @@
        int ret;
 
        ret = i915_gem_object_prepare_read(obj, &needs_clflush);
-
        if (ret)
                return ret;
 
diff -r b35ff9c8b808 -r 569f36914a72 sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c      Sun Dec 19 12:25:27 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c      Sun Dec 19 12:25:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_evict.c,v 1.5 2021/12/19 11:27:20 riastradh Exp $     */
+/*     $NetBSD: i915_gem_evict.c,v 1.6 2021/12/19 12:25:37 riastradh Exp $     */
 
 /*
  * Copyright © 2008-2010 Intel Corporation
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_evict.c,v 1.5 2021/12/19 11:27:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_evict.c,v 1.6 2021/12/19 12:25:37 riastradh Exp $");
 
 #include <drm/i915_drm.h>
 
@@ -258,15 +258,14 @@
                            struct drm_mm_node *target,
                            unsigned int flags)
 {
-       struct list_head eviction_list;
+       LIST_HEAD(eviction_list);
        struct drm_mm_node *node;
        u64 start = target->start;
        u64 end = start + target->size;
        struct i915_vma *vma, *next;
        int ret = 0;
 
-       INIT_LIST_HEAD(&eviction_list);
-       lockdep_assert_held(&vm->i915->drm.struct_mutex);
+       lockdep_assert_held(&vm->mutex);
        GEM_BUG_ON(!IS_ALIGNED(start, I915_GTT_PAGE_SIZE));
        GEM_BUG_ON(!IS_ALIGNED(end, I915_GTT_PAGE_SIZE));
 
diff -r b35ff9c8b808 -r 569f36914a72 sys/external/bsd/drm2/dist/drm/i915/i915_vma.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_vma.h    Sun Dec 19 12:25:27 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_vma.h    Sun Dec 19 12:25:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_vma.h,v 1.7 2021/12/19 11:37:41 riastradh Exp $   */
+/*     $NetBSD: i915_vma.h,v 1.8 2021/12/19 12:25:37 riastradh Exp $   */
 
 /*
  * Copyright © 2016 Intel Corporation
@@ -156,7 +156,7 @@
 
 static __always_inline ptrdiff_t ptrdiff(const void *a, const void *b)
 {
-       return (const char *)a - (const char *)b;
+       return a - b;
 }
 
 static inline long



Home | Main Index | Thread Index | Old Index