CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 09:58:30 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_tt.h

Log Message:
Re-introduce lost local diff.

We want declarations for ttm_tt_{,un}wire, and some different
members on struct ttm_tt

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h:1.4 src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h:1.5
--- src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h:1.4	Sun Dec 19 09:58:00 2021
+++ src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h	Sun Dec 19 09:58:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_tt.h,v 1.4 2021/12/19 09:58:00 riastradh Exp $	*/
+/*	$NetBSD: ttm_tt.h,v 1.5 2021/12/19 09:58:30 riastradh Exp $	*/
 
 /**
  *
@@ -111,7 +111,12 @@ struct ttm_tt {
 	uint32_t page_flags;
 	unsigned long num_pages;
 	struct sg_table *sg; /* for SG objects via dma-buf */
+#ifdef __NetBSD__
+	struct uvm_object *swap_storage;
+	struct pglist pglist;
+#else
 	struct file *swap_storage;
+#endif
 	enum ttm_caching_state caching_state;
 	enum {
 		tt_bound,
@@ -211,6 +216,25 @@ void ttm_tt_destroy(struct ttm_tt *ttm);
  */
 void ttm_tt_unbind(struct ttm_tt *ttm);
 
+#ifdef __NetBSD__
+/**
+ * ttm_tt_wire
+ *
+ * @ttm The struct ttm_tt.
+ *
+ * Wire the pages of a ttm_tt, allocating pages for it if necessary.
+ */
+extern int ttm_tt_wire(struct ttm_tt *ttm);
+
+/**
+ * ttm_tt_unwire
+ *
+ * @ttm The struct ttm_tt.
+ *
+ * Unwire the pages of a ttm_tt.
+ */
+extern void ttm_tt_unwire(struct ttm_tt *ttm);
+#else
 /**
  * ttm_tt_swapin:
  *
@@ -219,6 +243,7 @@ void ttm_tt_unbind(struct ttm_tt *ttm);
  * Swap in a previously swap out ttm_tt.
  */
 int ttm_tt_swapin(struct ttm_tt *ttm);
+#endif
 
 /**
  * ttm_tt_set_placement_caching:



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 09:58:30 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_tt.h

Log Message:
Re-introduce lost local diff.

We want declarations for ttm_tt_{,un}wire, and some different
members on struct ttm_tt

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 09:58:23 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_set_memory.h

Log Message:
Avoid the set_pages_array_wc/wb paths in TTM for now

we did this before. maybe we'll eventually want to stop for
performance reasons?

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_set_memory.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_set_memory.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_set_memory.h:1.2 src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_set_memory.h:1.3
--- src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_set_memory.h:1.2	Sat Dec 18 23:45:46 2021
+++ src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_set_memory.h	Sun Dec 19 09:58:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_set_memory.h,v 1.2 2021/12/18 23:45:46 riastradh Exp $	*/
+/*	$NetBSD: ttm_set_memory.h,v 1.3 2021/12/19 09:58:23 riastradh Exp $	*/
 
 /**
  *
@@ -35,7 +35,7 @@
 
 #include 
 
-#ifdef CONFIG_X86
+#if defined(CONFIG_X86) && defined(__linux__)
 
 #include 
 



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 09:58:23 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_set_memory.h

Log Message:
Avoid the set_pages_array_wc/wb paths in TTM for now

we did this before. maybe we'll eventually want to stop for
performance reasons?

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_set_memory.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 09:58:00 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_tt.h

Log Message:
constify

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h:1.3 src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h:1.4
--- src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h:1.3	Sun Dec 19 09:57:09 2021
+++ src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h	Sun Dec 19 09:58:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_tt.h,v 1.3 2021/12/19 09:57:09 riastradh Exp $	*/
+/*	$NetBSD: ttm_tt.h,v 1.4 2021/12/19 09:58:00 riastradh Exp $	*/
 
 /**
  *
@@ -106,7 +106,7 @@ struct ttm_backend_func {
  */
 struct ttm_tt {
 	struct ttm_bo_device *bdev;
-	struct ttm_backend_func *func;
+	const struct ttm_backend_func *func;
 	struct page **pages;
 	uint32_t page_flags;
 	unsigned long num_pages;



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 09:58:00 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_tt.h

Log Message:
constify

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 09:57:09 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_tt.h

Log Message:
Restore local diff

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h:1.2 src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h:1.3
--- src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h:1.2	Sat Dec 18 23:45:46 2021
+++ src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h	Sun Dec 19 09:57:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_tt.h,v 1.2 2021/12/18 23:45:46 riastradh Exp $	*/
+/*	$NetBSD: ttm_tt.h,v 1.3 2021/12/19 09:57:09 riastradh Exp $	*/
 
 /**
  *
@@ -133,7 +133,12 @@ struct ttm_tt {
  */
 struct ttm_dma_tt {
 	struct ttm_tt ttm;
+#ifdef __NetBSD__
+	bus_dma_segment_t *dma_segs;
+	bus_dmamap_t dma_address;
+#else
 	dma_addr_t *dma_address;
+#endif
 	struct list_head pages_list;
 };
 



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 09:57:09 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_tt.h

Log Message:
Restore local diff

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_tt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 09:55:14 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_bo_api.h

Log Message:
ifdef out things using vm_fault_t

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h:1.6 src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h:1.7
--- src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h:1.6	Sun Dec 19 01:49:36 2021
+++ src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h	Sun Dec 19 09:55:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_bo_api.h,v 1.6 2021/12/19 01:49:36 riastradh Exp $	*/
+/*	$NetBSD: ttm_bo_api.h,v 1.7 2021/12/19 09:55:14 riastradh Exp $	*/
 
 /**
  *
@@ -775,6 +775,7 @@ static inline bool ttm_bo_uses_embedded_
 /* Default number of pre-faulted pages in the TTM fault handler */
 #define TTM_BO_VM_NUM_PREFAULT 16
 
+#ifdef __linux__
 vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo,
 			 struct vm_fault *vmf);
 
@@ -790,5 +791,6 @@ void ttm_bo_vm_close(struct vm_area_stru
 
 int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,
 		 void *buf, int len, int write);
+#endif
 
 #endif



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 09:55:14 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_bo_api.h

Log Message:
ifdef out things using vm_fault_t

Author: Maya Rashish 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:49:37 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_bo_api.h

Log Message:
Move #endif earlier to avoid excluding useful prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h:1.5 src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h:1.6
--- src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h:1.5	Sat Dec 18 23:45:46 2021
+++ src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h	Sun Dec 19 01:49:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_bo_api.h,v 1.5 2021/12/18 23:45:46 riastradh Exp $	*/
+/*	$NetBSD: ttm_bo_api.h,v 1.6 2021/12/19 01:49:36 riastradh Exp $	*/
 
 /**
  *
@@ -719,12 +719,12 @@ int ttm_bo_mmap_obj(struct vm_area_struc
 int ttm_bo_mmap(struct file *filp, struct vm_area_struct *vma,
 		struct ttm_bo_device *bdev);
 
+#endif	/* __NetBSD__ */
+
 void *ttm_kmap_atomic_prot(struct page *page, pgprot_t prot);
 
 void ttm_kunmap_atomic_prot(void *addr, pgprot_t prot);
 
-#endif	/* __NetBSD__ */
-
 /**
  * ttm_bo_io
  *



CVS commit: src/sys/external/bsd/drm2/dist/include/drm/ttm

2021-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 01:49:37 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm/ttm: ttm_bo_api.h

Log Message:
Move #endif earlier to avoid excluding useful prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/include/drm/ttm/ttm_bo_api.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.