Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade libdrm-2.4.75 to libdrm-2.4.109 #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions ISSUES
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

Dec-30-2021 - Klaus Ziegler

Issues left over up from release 2.4.109:

1. This is just the upgrade from libdrm-2.4.75 to 2.4.109, no new functionality
of libdrm-2.4.109 has been checked or reflected in any manifest file, this
will be done in subsequent #PRs.

2. Implement dynamic creation of the new header file:

- generated_static_table_fourcc.h
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally causes less problems for people if you go ahead and check in the generated file,
and provide a make rule to (optionally) verify that regenerating the file produces the same.
This is the same approach described in UPDATE_LIB.
Oh, looks like you did "git add" that file, right?
Is there a rule to verify if matches what gets generated?


into the build process of gfx-drm using Python, the regular build process
of libdrm uses meson to build this header file. For the moment, the supplied
header file was created using a regular meson build of the library on SPARC
and Intel platforms to make sure there are no differences.

3. The creation of manual pages has been disabled in usr/src/man/Makefile
for subdirectories man3 and man7, because illumos based distributions up to
date don't include rst2man(1) command.

4. Get rid of 32bit support.
40 changes: 40 additions & 0 deletions UPDATE_LIB
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

Dec-30-2021 - Klaus Ziegler

To upgrade libdrm:

change LIBDRM_VERS in
usr/src/common/libdrm/Makefile
usr/src/common/libdrm/Makefile.drm
LIBDRM_HASH in
usr/src/common/libdrm/Makefile

If the file extension of the file to be downloaded has changed, it must be
changed in usr/src/pkg/manifests/x11-library-libdrm.mf and LIBDRM_ARCHIVE in
usr/src/common/libdrm/Makefile must be modified accordingly.

# NOTE: if you want to contribute changes to this graphics/DRM gate,
# please use your own fork of gfx-drm.git and substitute HTTPS/URL below,
# to match your repository.

After you have setup a build environment as follows:
git clone https://github.com/illumos/gfx-drm.git
cd gfx-drm
export BLDENV=tools/bldenv
chmod 755 tools/bldenv

edit myenv.sh to suite your needs, and start the first build:
/usr/bin/env -i $BLDENV myenv.sh "cd usr/src; make install"

most likely this first build will err'out right after unpacking
the new library archive. At this stage the make target: check
is run, which checks differences of gfx-drm headers and the
new library supplied headers, these 5 headers will be checked:

drm.h drm_fourcc.h drm_mode.h drm_sarea.h i915_drm.h

To pass check target, generate patch files for these headers:
cd usr/src/common/libdrm/libdrm-2.4.<new-version>/include/drm
gdiff -u drm.h <WS>/usr/src/uts/common/drm/drm.h > /tmp/drm.h.patch
and the others as well, then apply these patches to headers
contained in usr/src/uts/common/drm and restart the build.
2 changes: 1 addition & 1 deletion myenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export PKGARCHIVE="${CODEMGR_WS}/packages/${MACH}/nightly"
# export PKGPUBLISHER_REDIST='on-redist'

# Package manifest format version.
export PKGFMT_OUTPUT='v1'
export PKGFMT_OUTPUT='v2'

# Disable shadow compilation.
export CW_NO_SHADOW='1'
Expand Down
Empty file modified tools/bldenv
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions usr/src/Makefile.master
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ ELFEDIT= /usr/bin/elfedit
ELFSIGN= /usr/bin/elfsign
DTRACE= /usr/sbin/dtrace -xnolibs
UNIQ= /usr/bin/uniq
TAR= /usr/bin/tar
TAR= /usr/bin/gtar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a problem with plain old tar?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, we need to unpack an xz file now.

ASTBINDIR= /usr/ast/bin
MSGCC= $(ASTBINDIR)/msgcc
MSGFMT= /usr/bin/msgfmt -s
Expand Down Expand Up @@ -300,7 +300,7 @@ CCABS32= -Wc,-xcode=abs32
#
# generate v9 code which tolerates callers using the v7 ABI, for the sake of
# system calls.
CC32BITCALLERS= -_gcc=-massume-32bit-callers
CC32BITCALLERS=

# GCC, especially, is increasingly beginning to auto-inline functions and
# sadly does so separately not under the general -fno-inline-functions
Expand Down
5 changes: 3 additions & 2 deletions usr/src/cmd/drm-tests/Run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
# /opt/drm-tests/Run_all.sh > drm-tests.log
#

# Leaving out random (takes a while)
# Leaving out random (takes a while), and in the meantime has been removed.
# Also updatedraw (broken at the moment)
TESTS="drmdevice dristat drmstat drmsl hash"
# Deleted dristat drmstat from list below, also gone.
TESTS="drmdevice drmsl hash"

run_all() {
for f in $TESTS ; do
Expand Down
1 change: 0 additions & 1 deletion usr/src/cmd/drm-tests/misc1/Makefile.com
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
PROG= \
drmsl \
hash \
random \
drmdevice

include ../../Makefile.drm
Expand Down
4 changes: 3 additions & 1 deletion usr/src/cmd/drm-tests/modeprint/Makefile.com
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ include ../../Makefile.drm

SRCDIR= $(LIBDRM_CMN_DIR)/tests/modeprint

LDLIBS += -ldrm -lm
LDLIBS += -ldrm -lm -lutil

LDLIBS32 += -L$(ROOT)/usr/lib/xorg \
-L$(SRC)/cmd/drm-tests/util/$(MACH) \
-R/usr/lib/xorg
LDLIBS64 += -L$(ROOT)/usr/lib/xorg/$(MACH64) \
-L$(SRC)/cmd/drm-tests/util/$(MACH64) \
-R/usr/lib/xorg/$(MACH64)

all: $(PROG)
Expand Down
12 changes: 3 additions & 9 deletions usr/src/common/libdrm/Check-patches
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
# One big patch might be easier than all this...
# but for now the patches are split up as shown below.

ref=libdrm-2.4.75-ref
dir=libdrm-2.4.75
ref=libdrm-2.4.109-ref
dir=libdrm-2.4.109

# You make this directory by hand. Not doing this automatically
# because I want to make srue you to know it's being written into.
Expand Down Expand Up @@ -106,18 +106,12 @@ diff_ref libdrm_lists.h > $chk/libdrm-lists-h.patch
echo patches/util-double-list-h.patch
diff_ref util_double_list.h > $chk/util-double-list-h.patch

echo patches/util-math-h.patch
diff_ref util_math.h > $chk/util-math-h.patch

echo patches/xf86drm-c.patch
diff_ref xf86drm.c > $chk/xf86drm-c.patch

echo patches/xf86drm-h.patch
( head -27 patches/xf86drm-h.patch ;
diff_ref xf86drm.h ) > $chk/xf86drm-h.patch

echo patches/xf86drmMode-c.patch
diff_ref xf86drmMode.c > $chk/xf86drmMode-c.patch


diff -r patches $chk
diff -r patches $chk
8 changes: 4 additions & 4 deletions usr/src/common/libdrm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ FETCH= $(PYTHON) $(SRC)/tools/userland-fetch

# See also: ./Makefile.drm LIBDRM_VERS and ./Check-patches
# PLEASE RUN Check-patches after updating!
LIBDRM_VERS=2.4.75
LIBDRM_VERS=2.4.109

LIBDRM_DIR=libdrm-$(LIBDRM_VERS)
LIBDRM_ARCHIVE=$(LIBDRM_DIR).tar.bz2
LIBDRM_ARCHIVE=$(LIBDRM_DIR).tar.xz
LIBDRM_URL=http://dri.freedesktop.org/libdrm/$(LIBDRM_ARCHIVE)
LIBDRM_HASH=sha256:2d5a500eef412cc287d12268eed79d571e262d4957a2ec9258073f305985054f
LIBDRM_HASH=sha256:629352e08c1fe84862ca046598d8a08ce14d26ab25ee1f4704f993d074cb7f26

def all install install_h: .patched check

Expand Down Expand Up @@ -59,7 +59,7 @@ check: FRC
touch $@

.unpacked: $(USERLAND_ARCHIVES)$(LIBDRM_ARCHIVE)
tar xvfjo $(USERLAND_ARCHIVES)$(LIBDRM_ARCHIVE)
gtar xvfJo $(USERLAND_ARCHIVES)$(LIBDRM_ARCHIVE)
touch $@

$(USERLAND_ARCHIVES)$(LIBDRM_ARCHIVE) :
Expand Down
2 changes: 1 addition & 1 deletion usr/src/common/libdrm/Makefile.drm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# This make include is used in $SRC/lib/libdrm/*
#
# See also: ./Makefile LIBDRM_VERS, ./Check-patches
LIBDRM_VERS=2.4.75
LIBDRM_VERS=2.4.109

LIBDRM_CMN_DIR=$(SRC)/common/libdrm/libdrm-$(LIBDRM_VERS)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* AUTOMATICALLY GENERATED by gen_table_fourcc.py. You should modify
that script instead of adding here entries manually! */
static const struct drmFormatModifierInfo drm_format_modifier_table[] = {
{ DRM_MODIFIER_INVALID(NONE, INVALID_MODIFIER) },
{ DRM_MODIFIER_LINEAR(NONE, LINEAR) },
{ DRM_MODIFIER_INTEL(X_TILED, X_TILED) },
{ DRM_MODIFIER_INTEL(Y_TILED, Y_TILED) },
{ DRM_MODIFIER_INTEL(Yf_TILED, Yf_TILED) },
{ DRM_MODIFIER_INTEL(Y_TILED_CCS, Y_TILED_CCS) },
{ DRM_MODIFIER_INTEL(Yf_TILED_CCS, Yf_TILED_CCS) },
{ DRM_MODIFIER_INTEL(Y_TILED_GEN12_RC_CCS, Y_TILED_GEN12_RC_CCS) },
{ DRM_MODIFIER_INTEL(Y_TILED_GEN12_MC_CCS, Y_TILED_GEN12_MC_CCS) },
{ DRM_MODIFIER_INTEL(Y_TILED_GEN12_RC_CCS_CC, Y_TILED_GEN12_RC_CCS_CC) },
{ DRM_MODIFIER(SAMSUNG, 64_32_TILE, 64_32_TILE) },
{ DRM_MODIFIER(SAMSUNG, 16_16_TILE, 16_16_TILE) },
{ DRM_MODIFIER(QCOM, COMPRESSED, COMPRESSED) },
{ DRM_MODIFIER(VIVANTE, TILED, TILED) },
{ DRM_MODIFIER(VIVANTE, SUPER_TILED, SUPER_TILED) },
{ DRM_MODIFIER(VIVANTE, SPLIT_TILED, SPLIT_TILED) },
{ DRM_MODIFIER(VIVANTE, SPLIT_SUPER_TILED, SPLIT_SUPER_TILED) },
{ DRM_MODIFIER(NVIDIA, TEGRA_TILED, TEGRA_TILED) },
{ DRM_MODIFIER(NVIDIA, 16BX2_BLOCK_ONE_GOB, 16BX2_BLOCK_ONE_GOB) },
{ DRM_MODIFIER(NVIDIA, 16BX2_BLOCK_TWO_GOB, 16BX2_BLOCK_TWO_GOB) },
{ DRM_MODIFIER(NVIDIA, 16BX2_BLOCK_FOUR_GOB, 16BX2_BLOCK_FOUR_GOB) },
{ DRM_MODIFIER(NVIDIA, 16BX2_BLOCK_EIGHT_GOB, 16BX2_BLOCK_EIGHT_GOB) },
{ DRM_MODIFIER(NVIDIA, 16BX2_BLOCK_SIXTEEN_GOB, 16BX2_BLOCK_SIXTEEN_GOB) },
{ DRM_MODIFIER(NVIDIA, 16BX2_BLOCK_THIRTYTWO_GOB, 16BX2_BLOCK_THIRTYTWO_GOB) },
{ DRM_MODIFIER(BROADCOM, VC4_T_TILED, VC4_T_TILED) },
{ DRM_MODIFIER(BROADCOM, SAND32, SAND32) },
{ DRM_MODIFIER(BROADCOM, SAND64, SAND64) },
{ DRM_MODIFIER(BROADCOM, SAND128, SAND128) },
{ DRM_MODIFIER(BROADCOM, SAND256, SAND256) },
{ DRM_MODIFIER(BROADCOM, UIF, UIF) },
{ DRM_MODIFIER(ARM, 16X16_BLOCK_U_INTERLEAVED, 16X16_BLOCK_U_INTERLEAVED) },
{ DRM_MODIFIER(ALLWINNER, TILED, TILED) },
};
static const struct drmFormatModifierVendorInfo drm_format_modifier_vendor_table[] = {
{ DRM_FORMAT_MOD_VENDOR_NONE, "NONE" },
{ DRM_FORMAT_MOD_VENDOR_INTEL, "INTEL" },
{ DRM_FORMAT_MOD_VENDOR_AMD, "AMD" },
{ DRM_FORMAT_MOD_VENDOR_NVIDIA, "NVIDIA" },
{ DRM_FORMAT_MOD_VENDOR_SAMSUNG, "SAMSUNG" },
{ DRM_FORMAT_MOD_VENDOR_QCOM, "QCOM" },
{ DRM_FORMAT_MOD_VENDOR_VIVANTE, "VIVANTE" },
{ DRM_FORMAT_MOD_VENDOR_BROADCOM, "BROADCOM" },
{ DRM_FORMAT_MOD_VENDOR_ARM, "ARM" },
{ DRM_FORMAT_MOD_VENDOR_ALLWINNER, "ALLWINNER" },
{ DRM_FORMAT_MOD_VENDOR_AMLOGIC, "AMLOGIC" },
};
8 changes: 4 additions & 4 deletions usr/src/common/libdrm/patches/etnaviv.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- libdrm-2.4.71/etnaviv/etnaviv_device.c.old 2016-10-18 23:11:06.163832408 +0300
+++ libdrm-2.4.71/etnaviv/etnaviv_device.c 2016-10-18 23:12:18.805796392 +0300
@@ -29,8 +29,8 @@
#endif
--- libdrm-2.4.109/etnaviv/etnaviv_device.c.orig 2021-11-25 21:33:02.000000000 +0000
+++ libdrm-2.4.109/etnaviv/etnaviv_device.c 2021-12-28 12:57:52.347557016 +0000
@@ -25,8 +25,8 @@
*/

#include <stdlib.h>
-#include <linux/stddef.h>
Expand Down
25 changes: 11 additions & 14 deletions usr/src/common/libdrm/patches/exynos.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff ... libdrm-2.4.73/exynos/exynos_drm.c
--- libdrm-2.4.73-ref/exynos/exynos_drm.c Wed Aug 24 12:57:39 2016
+++ libdrm-2.4.73/exynos/exynos_drm.c Sat Dec 31 12:27:53 2016
@@ -35,7 +35,7 @@
--- libdrm-2.4.109/exynos/exynos_drm.c.orig 2021-11-25 21:33:02.000000000 +0000
+++ libdrm-2.4.109/exynos/exynos_drm.c 2021-12-28 12:57:52.350690170 +0000
@@ -31,7 +31,7 @@
#include <unistd.h>

#include <sys/mman.h>
Expand All @@ -10,10 +9,9 @@ diff ... libdrm-2.4.73/exynos/exynos_drm.c

#include <xf86drm.h>

diff ... libdrm-2.4.73/exynos/exynos_fimg2d.c
--- libdrm-2.4.73-ref/exynos/exynos_fimg2d.c Wed Aug 24 12:57:39 2016
+++ libdrm-2.4.73/exynos/exynos_fimg2d.c Sat Dec 31 17:52:27 2016
@@ -21,7 +21,7 @@
--- libdrm-2.4.109/exynos/exynos_fimg2d.c.orig 2021-11-25 21:33:02.000000000 +0000
+++ libdrm-2.4.109/exynos/exynos_fimg2d.c 2021-12-28 12:57:52.351308656 +0000
@@ -30,7 +30,7 @@
#include <assert.h>

#include <sys/mman.h>
Expand All @@ -22,7 +20,7 @@ diff ... libdrm-2.4.73/exynos/exynos_fimg2d.c

#include <xf86drm.h>

@@ -698,9 +698,10 @@
@@ -693,9 +693,10 @@
if (negative)
negative = 1;

Expand All @@ -35,7 +33,7 @@ diff ... libdrm-2.4.73/exynos/exynos_fimg2d.c
scale = 1;
scale_x = g2d_get_scaling(src_w, dst_w);
scale_y = g2d_get_scaling(src_h, dst_h);
@@ -920,9 +921,10 @@
@@ -915,9 +916,10 @@
unsigned int scale, gem_space;
unsigned int scale_x, scale_y;

Expand All @@ -48,10 +46,9 @@ diff ... libdrm-2.4.73/exynos/exynos_fimg2d.c
scale = 1;
scale_x = g2d_get_scaling(src_w, dst_w);
scale_y = g2d_get_scaling(src_h, dst_h);
diff ... libdrm-2.4.73/tests/exynos/exynos_fimg2d_test.c
--- libdrm-2.4.73-ref/tests/exynos/exynos_fimg2d_test.c Wed Aug 24 12:57:39 2016
+++ libdrm-2.4.73/tests/exynos/exynos_fimg2d_test.c Sat Dec 31 12:27:53 2016
@@ -22,7 +22,7 @@
--- libdrm-2.4.109/tests/exynos/exynos_fimg2d_test.c.orig 2021-11-25 21:33:02.000000000 +0000
+++ libdrm-2.4.109/tests/exynos/exynos_fimg2d_test.c 2021-12-28 12:57:52.351698146 +0000
@@ -31,7 +31,7 @@
#include <unistd.h>

#include <sys/mman.h>
Expand Down
26 changes: 7 additions & 19 deletions usr/src/common/libdrm/patches/freedreno.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
diff ... libdrm-2.4.73/freedreno/kgsl/kgsl_bo.c
--- libdrm-2.4.73-ref/freedreno/kgsl/kgsl_bo.c Wed Aug 24 12:57:41 2016
+++ libdrm-2.4.73/freedreno/kgsl/kgsl_bo.c Sat Dec 31 12:27:53 2016
@@ -32,7 +32,5 @@
--- libdrm-2.4.109/freedreno/kgsl/kgsl_bo.c.orig 2021-11-25 21:33:02.000000000 +0000
+++ libdrm-2.4.109/freedreno/kgsl/kgsl_bo.c 2021-12-29 08:58:14.846699228 +0000
@@ -28,7 +28,9 @@

#include "kgsl_priv.h"

-#include <linux/fb.h>
-
+#ifndef __sun
#include <linux/fb.h>
+#endif

static int set_memtype(struct fd_device *dev, uint32_t handle, uint32_t flags)
{
diff ... libdrm-2.4.73/freedreno/kgsl/kgsl_ringbuffer.c
--- libdrm-2.4.73-ref/freedreno/kgsl/kgsl_ringbuffer.c Mon Nov 14 12:55:20 2016
+++ libdrm-2.4.73/freedreno/kgsl/kgsl_ringbuffer.c Sat Dec 31 18:02:19 2016
@@ -146,7 +146,8 @@
ibdesc.gpuaddr = kgsl_ring->bo->gpuaddr;
ibdesc.hostptr = kgsl_ring->bo->hostptr;
ibdesc.sizedwords = 0x145;
- req.timestamp = (uint32_t)kgsl_ring->bo->hostptr;
+ /* This way to avoid GCC -Wpointer-to-int-cast */
+ req.timestamp = (unsigned int) (unsigned long) kgsl_ring->bo->hostptr;
}

do {
10 changes: 4 additions & 6 deletions usr/src/common/libdrm/patches/incl-drm-drm-h.patch
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
# or other dealings in this Software without prior written authorization
# of the copyright holder.

diff -u ... libdrm-2.4.73/include/drm/drm.h
index 8adb9d5..f9bedd0 100644
--- libdrm-2.4.73-ref/include/drm/drm.h Mon Nov 14 14:46:05 2016
+++ libdrm-2.4.73/include/drm/drm.h Mon Nov 28 14:32:21 2016
--- libdrm-2.4.109/include/drm/drm.h.orig 2021-11-25 21:33:02.000000000 +0000
+++ libdrm-2.4.109/include/drm/drm.h 2021-12-28 13:56:31.700232551 +0000
@@ -55,14 +55,40 @@
typedef int64_t __s64;
typedef uint64_t __u64;
Expand Down Expand Up @@ -80,7 +78,7 @@ index 8adb9d5..f9bedd0 100644
+ _DRM_GEM = 6 /**< GEM object (XXX: Not libdrm?) */
};

/**
/*
@@ -214,12 +241,13 @@
* \sa drmAddMap().
*/
Expand Down Expand Up @@ -135,4 +133,4 @@ index 8adb9d5..f9bedd0 100644
+ int fd;
};

/**
/*
Loading