Page MenuHomeFreeBSD

linuxkpi: Move shmem related function in it's own file
ClosedPublic

Authored by manu on Feb 19 2020, 9:03 PM.

Details

Summary

For drmkpi (D23085) we don't want the Linux struct file as we don't emulate
everything. Also the prototypes should be in shmem_fs.h to have 100%
compatibility with Linux.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

manu created this revision.Feb 19 2020, 9:03 PM

You also need to update sys/conf/files with the new file.

manu updated this revision to Diff 68562.Feb 19 2020, 9:59 PM

Add the new file to sys/conf/files

manu added a comment.Feb 19 2020, 9:59 PM

You also need to update sys/conf/files with the new file.

Yep, sorry. It's done now.

You need to bump the __FreeBSD_version to xxx80, because the following change is needed in drm-kms: @zeising Please ack!

@manu : This change should not be MFC'ed for now.

From c2faeead8478457b465617bf0edde2ad72558469 Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hps@selasky.org>
Date: Thu, 20 Feb 2020 12:03:04 +0100
Subject: [PATCH] Update code after header file change in -current.

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
---
 linuxkpi/dummy/include/linux/shmem_fs.h | 0
 linuxkpi/gplv2/include/linux/shmem_fs.h | 3 +++
 2 files changed, 3 insertions(+)
 delete mode 100644 linuxkpi/dummy/include/linux/shmem_fs.h
 create mode 100644 linuxkpi/gplv2/include/linux/shmem_fs.h

diff --git a/linuxkpi/dummy/include/linux/shmem_fs.h b/linuxkpi/dummy/include/linux/shmem_fs.h
deleted file mode 100644
index e69de29bb..000000000
diff --git a/linuxkpi/gplv2/include/linux/shmem_fs.h b/linuxkpi/gplv2/include/linux/shmem_fs.h
new file mode 100644
index 000000000..37bfb6797
--- /dev/null
+++ b/linuxkpi/gplv2/include/linux/shmem_fs.h
@@ -0,0 +1,3 @@
+#if __FreeBSD_version >= 1300080
+#include_next <linux/shmem_fs.h>
+#endif
-- 
2.25.0
manu added a comment.Feb 20 2020, 12:01 PM

You need to bump the __FreeBSD_version to xxx80, because the following change is needed in drm-kms: @zeising Please ack!
@manu : This change should not be MFC'ed for now.

From c2faeead8478457b465617bf0edde2ad72558469 Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hps@selasky.org>
Date: Thu, 20 Feb 2020 12:03:04 +0100
Subject: [PATCH] Update code after header file change in -current.
Signed-off-by: Hans Petter Selasky <hps@selasky.org>
---
 linuxkpi/dummy/include/linux/shmem_fs.h | 0
 linuxkpi/gplv2/include/linux/shmem_fs.h | 3 +++
 2 files changed, 3 insertions(+)
 delete mode 100644 linuxkpi/dummy/include/linux/shmem_fs.h
 create mode 100644 linuxkpi/gplv2/include/linux/shmem_fs.h
diff --git a/linuxkpi/dummy/include/linux/shmem_fs.h b/linuxkpi/dummy/include/linux/shmem_fs.h
deleted file mode 100644
index e69de29bb..000000000
diff --git a/linuxkpi/gplv2/include/linux/shmem_fs.h b/linuxkpi/gplv2/include/linux/shmem_fs.h
new file mode 100644
index 000000000..37bfb6797
--- /dev/null
+++ b/linuxkpi/gplv2/include/linux/shmem_fs.h
@@ -0,0 +1,3 @@
+#if __FreeBSD_version >= 1300080
+#include_next <linux/shmem_fs.h>
+#endif
-- 
2.25.0

Thanks,
Can you submit this patch to the v5.0 branch of kms-drm ? There is another PR to merge so doing a new release with both would save time.

I've seen this, I'll fix the drm drivers and update tonight.

In D23764#522191, @manu wrote:

You need to bump the __FreeBSD_version to xxx80, because the following change is needed in drm-kms: @zeising Please ack!
@manu : This change should not be MFC'ed for now.

From c2faeead8478457b465617bf0edde2ad72558469 Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hps@selasky.org>
Date: Thu, 20 Feb 2020 12:03:04 +0100
Subject: [PATCH] Update code after header file change in -current.
Signed-off-by: Hans Petter Selasky <hps@selasky.org>
---
 linuxkpi/dummy/include/linux/shmem_fs.h | 0
 linuxkpi/gplv2/include/linux/shmem_fs.h | 3 +++
 2 files changed, 3 insertions(+)
 delete mode 100644 linuxkpi/dummy/include/linux/shmem_fs.h
 create mode 100644 linuxkpi/gplv2/include/linux/shmem_fs.h
diff --git a/linuxkpi/dummy/include/linux/shmem_fs.h b/linuxkpi/dummy/include/linux/shmem_fs.h
deleted file mode 100644
index e69de29bb..000000000
diff --git a/linuxkpi/gplv2/include/linux/shmem_fs.h b/linuxkpi/gplv2/include/linux/shmem_fs.h
new file mode 100644
index 000000000..37bfb6797
--- /dev/null
+++ b/linuxkpi/gplv2/include/linux/shmem_fs.h
@@ -0,0 +1,3 @@
+#if __FreeBSD_version >= 1300080
+#include_next <linux/shmem_fs.h>
+#endif
-- 
2.25.0

Thanks,
Can you submit this patch to the v5.0 branch of kms-drm ? There is another PR to merge so doing a new release with both would save time.

I think it's needed for both 4.16 and 5.0 branch.

manu added a comment.Feb 20 2020, 12:10 PM
In D23764#522191, @manu wrote:

You need to bump the __FreeBSD_version to xxx80, because the following change is needed in drm-kms: @zeising Please ack!
@manu : This change should not be MFC'ed for now.

From c2faeead8478457b465617bf0edde2ad72558469 Mon Sep 17 00:00:00 2001
From: Hans Petter Selasky <hps@selasky.org>
Date: Thu, 20 Feb 2020 12:03:04 +0100
Subject: [PATCH] Update code after header file change in -current.
Signed-off-by: Hans Petter Selasky <hps@selasky.org>
---
 linuxkpi/dummy/include/linux/shmem_fs.h | 0
 linuxkpi/gplv2/include/linux/shmem_fs.h | 3 +++
 2 files changed, 3 insertions(+)
 delete mode 100644 linuxkpi/dummy/include/linux/shmem_fs.h
 create mode 100644 linuxkpi/gplv2/include/linux/shmem_fs.h
diff --git a/linuxkpi/dummy/include/linux/shmem_fs.h b/linuxkpi/dummy/include/linux/shmem_fs.h
deleted file mode 100644
index e69de29bb..000000000
diff --git a/linuxkpi/gplv2/include/linux/shmem_fs.h b/linuxkpi/gplv2/include/linux/shmem_fs.h
new file mode 100644
index 000000000..37bfb6797
--- /dev/null
+++ b/linuxkpi/gplv2/include/linux/shmem_fs.h
@@ -0,0 +1,3 @@
+#if __FreeBSD_version >= 1300080
+#include_next <linux/shmem_fs.h>
+#endif
-- 
2.25.0

Thanks,
Can you submit this patch to the v5.0 branch of kms-drm ? There is another PR to merge so doing a new release with both would save time.

I think it's needed for both 4.16 and 5.0 branch.

Indeed.

I just made a PR for this in the drm-kms repo, can you please have a look in case I screwed something up.
https://github.com/FreeBSDDesktop/kms-drm/pull/219

Idea is to merge it to v4.16 and then pick it into 5.0.

manu added a comment.Feb 21 2020, 9:15 AM

@hselasky are you ok with the review ?
I don't put _FreeBSD_version bump in review as it's something that could change between the time the review is created and when it's commited.

hselasky accepted this revision.Feb 21 2020, 9:16 AM

Just do a GENERIC buildkernel on amd64 before pushing.

This revision is now accepted and ready to land.Feb 21 2020, 9:16 AM
This revision was automatically updated to reflect the committed changes.