Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Slow, lagging desktop GUI with AMDGPU-PRO
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Sat Mar 04, 2017 2:29 pm    Post subject: [SOLVED] Slow, lagging desktop GUI with AMDGPU-PRO Reply with quote

I have been having this little problem for a while. I'm running KDE on a desktop machine with an AMD RX 480. However, while the 3d performance is great, the KDE GUI is horribly lagging. Everything else works great, including Vulkan. The only problem seems to be plain desktop applications, such as Konqueror or Kile. They just lag terribly and are very, very slow. Incidentally, if I switch to the open-source driver (eselect opengl xorg-x11) the problem entirely disappears. I have tried to check all sort of things, but I just can't figure out what the problem actually is. For the record, I'm running kernel 4.9.6-gentoo-r1, mesa-17.0.0, llvm-3.9.0-r1, libdrm-2.4.73, and the driver version is 16.60-379184.

Any ideas or help? :)


Last edited by paraw on Tue Mar 14, 2017 8:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
ShyPixie
n00b
n00b


Joined: 20 Nov 2015
Posts: 19
Location: Brazil

PostPosted: Wed Mar 08, 2017 4:48 pm    Post subject: Reply with quote

What's the output of:

$ cat /etc/X11/xorg.conf.d/*
$ LIBGL_DEBUG=verbose glxinfo | grep libGL
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Wed Mar 08, 2017 8:56 pm    Post subject: Reply with quote

So, in /etc/X11/xorg.conf.d/ I have:

Code:

10-device.conf:

Section "Device"
        Identifier  "Sapphire AMD RX 480 Nitro+"
        Driver      "amdgpu"
        BusID       "PCI:1:0:0"
        Option          "AccelMethod" "glamor"
        Option      "DRI" "3"
        Option          "TearFree" "on"
EndSection


Code:

10-monitor.conf:

Section "Monitor"
        Identifier   "Dell Ultrasharp"
        VendorName   "Dell, Inc."
        ModelName    "U2311H"
        Option       "DPMS"   "true"
EndSection


Code:

10-screen.conf:

Section "Screen"
                Identifier      "Screen0"
                DefaultDepth    24
                SubSection      "Display"
                                Depth   24
                EndSubSection
EndSection


and

Code:

20opengl.conf:

Section "Files"
        ModulePath "/usr/lib32/xorg/modules"
        ModulePath "/usr/lib64/opengl/amdgpu-pro"
        ModulePath "/usr/lib64/xorg/modules"
EndSection


As for glxinfo, I get
Code:

libGL: DRI3 is disabled, try running in DRI2 mode. xorg version is 0                                                                                                                                               
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/amdgpu_dri.so                                                                                                                                         
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so


For your information, /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so is a link to /usr/lib/opengl/amdgpu-pro/dri/amdgpu_dri.so and DRI3 seems active according to the X log, so I don't know why GLX doesn't see it:
Code:

grep DRI /var/log/Xorg.0.log

[    73.255] (**) AMDGPU(0): Option "DRI" "3"
[    74.590] (II) AMDGPU(0): [DRI2] Setup complete
[    74.590] (II) AMDGPU(0): [DRI2]   DRI driver: amdgpu
[    74.590] (II) AMDGPU(0): [DRI2]   VDPAU driver: amdgpu
[    74.591] (**) AMDGPU(0): DRI3 enabled
[    74.650] (II) GLX: Initialized DRI2 GL provider for screen 0
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Tue Mar 14, 2017 6:39 pm    Post subject: Reply with quote

Im facing other problems.
Vulkan is not working for me, and glxinfo report me some errors.

Im using vulkan overlay ebuilds
x11-libs/libdrm-2.4.70-r1::vulkan
x11-drivers/amdgpu-pro-16.60.379184-r1:1::vulkan
media-libs/mesa-9999::vulkan

https://github.com/Lucretia/vulkan-overlay

glxinfo | grep libGL
Quote:
Xlib: extension "AMDGPU" missing on display ":0".
Xlib: extension "AMDGPU" missing on display ":0".
Xlib: extension "AMDGPU" missing on display ":0".


desktop is working great, and opengl too. no vulkan...

cat /etc/X11/xorg.conf.d/*
Quote:
Section "Device"
Identifier "RX480_1"
Driver "amdgpu"
BusID "PCI:1:0:0"
Option "DRI" "3"
Option "AccelMethod" "glamor"
Option "TearFree" "on"
EndSection
Section "Monitor"
Identifier "Your monitor name"
VendorName "The make"
ModelName "The model"
Option "DPMS" "true" # Might want to turn this off if using an R9 390
EndSection
Section "Screen"
Identifier "Your screen name"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
Section "Files"
ModulePath "/usr/lib64/opengl/amdgpu-pro"
ModulePath "/usr/lib32/opengl/amdgpu-pro"
ModulePath "/usr/lib64/xorg/modules"
EndSection



glxgears works great, but same error...

glxgears
Quote:
Xlib: extension "AMDGPU" missing on display ":0".
38067 frames in 5.0 seconds = 7613.325 FPS
38789 frames in 5.0 seconds = 7757.763 FPS
39698 frames in 5.0 seconds = 7939.597 FPS
39720 frames in 5.0 seconds = 7943.838 FPS

_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Tue Mar 14, 2017 8:52 pm    Post subject: Reply with quote

So. Solved. It was due to some version incompatibility that I had not detected. Anyway, pelelademadera, do the following (thinking of it, this could be used as a guide).

First of all, uninstall what you have. Make sure in /etc/portage/make.conf you have
VIDEO_CARDS="amdgpu radeonsi"
If needed, update your system (emerge --update --deep --newuse -1 world).

After this, emerge linux-firmware.
Make sure you are running the latest kernel (4.9.16-r1).
In your kernel configuration, make sure some options are as follows (please note that some must be modules):
Code:
CONFIG_MTRR = y
CONFIG_MTRR_SANITIZER = y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT = 1
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT = 2
CONFIG_FW_LOADER = y
CONFIG_FIRMWARE_IN_KERNEL = y
CONFIG_EXTRA_FIRMWARE = "amdgpu/polaris10_ce.bin amdgpu/polaris10_mc.bin amdgpu/polaris10_me.bin amdgpu/polaris10_mec2.bin amdgpu/polaris10_mec.bin amdgpu/polaris10_pfp.bin amdgpu/polaris10_rlc.bin amdgpu/polaris10_sdma1.bin amdgpu/polaris10_sdma.bin amdgpu/polaris10_smc.bin amdgpu/polaris10_smc_sk.bin amdgpu/polaris10_uvd.bin amdgpu/polaris10_vce.bin"
CONFIG_EXTRA_FIRMWARE_DIR = "/lib/firmware"
CONFIG_AGP = y
CONFIG_VGA_SWITCHEROO = y
CONFIG_DRM = y
CONFIG_DRM_FBDEV_EMULATION = y
CONFIG_DRM_AMDGPU = m
CONFIG_DRM_AMDGPU_USERPTR = y
CONFIG_FB = y
CONFIG_FB_MODE_HELPERS = y
CONFIG_FB_VESA = y
CONFIG_FB_RADEON = m
CONFIG_FB_RADEON_I2C = y
CONFIG_FB_RADEON_BACKLIGHT = y

If needed, recompile the kernel and make sure modules, firmware and system map are installed. For example
Code:
make
make modules_install
make firmware_install
cp arch/x86/boot/bzImage /boot/kernel
cp System.map /boot/System.map-4.9.16-gentoo

Reboot into the new kernel.

Then, install the farmboy0 overlay, and emerge dkms.

Then, make a local overlay, I call mine "parawlay" 8)
Inside it, create the category x11-drivers, and inside this the directory amdgpu-pro. Inside that, put this ebuild. Change the monitor and device sections with the name of your hardware, of course.

amdgpu-pro-16.60.379184.ebuild
Code:
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

MULTILIB_COMPAT=( abi_x86_{32,64} )
#inherit eutils linux-info multilib-build unpacker
inherit multilib-build unpacker

DESCRIPTION="AMD precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
HOMEPAGE="http://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Driver-for-Linux-Release-Notes.aspx"
PKG_VER=16.60
PKG_REV=379184
PKG_VER_STRING=${PKG_VER}-${PKG_REV}
BUILD_VER=${PKG_VER}.${PKG_REV}
SRC_URI="https://www2.ati.com/drivers/linux/ubuntu/amdgpu-pro-${PKG_VER_STRING}.tar.xz"

RESTRICT="fetch strip"

# The binary blobs include binaries for other open sourced packages, we don't want to include those parts, if they are
# selected, they should come from portage.
IUSE="gles2 opencl +opengl vdpau +vulkan"

LICENSE="AMD GPL-2 QPL-1.0"
KEYWORDS="~amd64"
SLOT="1"

RDEPEND="
        >=app-eselect/eselect-opengl-1.0.7
        app-eselect/eselect-opencl
        dev-libs/openssl[${MULTILIB_USEDEP}]
        dev-util/cunit
        media-libs/gst-plugins-base[${MULTILIB_USEDEP}]
        media-libs/gstreamer[${MULTILIB_USEDEP}]
        !vulkan? ( media-libs/mesa[openmax] )
        vulkan? ( || ( <=media-libs/mesa-13.0.0[openmax] >=media-libs/mesa-13.0.1[openmax,-vulkan] ) media-libs/vulkan-loader )
        <sys-libs/ncurses-6.0[${MULTILIB_USEDEP},tinfo]
        =x11-base/xorg-drivers-1.18-r1
        =x11-base/xorg-server-1.18.4[glamor]
        >=x11-libs/libdrm-2.4.70
        x11-libs/libX11[${MULTILIB_USEDEP}]
        x11-libs/libXext[${MULTILIB_USEDEP}]
        x11-libs/libXinerama[${MULTILIB_USEDEP}]
        x11-libs/libXrandr[${MULTILIB_USEDEP}]
        x11-libs/libXrender[${MULTILIB_USEDEP}]
        x11-proto/inputproto
        x11-proto/xf86miscproto
        x11-proto/xf86vidmodeproto
        x11-proto/xineramaproto
"
DEPEND="
        >=sys-firmware/amdgpu-ucode-20160628
"

S="${WORKDIR}"

pkg_nofetch() {
        einfo "Please download"
        einfo "  - ${PN}_${PV}.tar.xz"
        einfo "from ${HOMEPAGE} and place them in ${DISTDIR}"
}

unpack_deb() {
        echo ">>> Unpacking ${1##*/} to ${PWD}"
        unpack $1
        unpacker ./data.tar*
        rm -f debian-binary {control,data}.tar*
}

src_unpack() {
        default

        unpack_deb "amdgpu-pro-16.60-379184/libgl1-amdgpu-pro-appprofiles_${PKG_VER_STRING}_all.deb"
        unpack_deb "amdgpu-pro-16.60-379184/libdrm-amdgpu-pro-utils_2.4.70-379184_amd64.deb"

        if use opencl ; then
                # Install clinfo
                unpack_deb "amdgpu-pro-16.60-379184/clinfo-amdgpu-pro_${PKG_VER_STRING}_amd64.deb"

                # Install OpenCL library
                unpack_deb "amdgpu-pro-16.60-379184/libopencl1-amdgpu-pro_${PKG_VER_STRING}_amd64.deb"

                # Install the OpenCL ICD
                unpack_deb "amdgpu-pro-16.60-379184/opencl-amdgpu-pro-icd_${PKG_VER_STRING}_amd64.deb"

                if use abi_x86_32 ; then
                        unpack_deb "amdgpu-pro-16.60-379184/libopencl1-amdgpu-pro_${PKG_VER_STRING}_i386.deb"
                        unpack_deb "amdgpu-pro-16.60-379184/opencl-amdgpu-pro-icd_${PKG_VER_STRING}_i386.deb"
                fi
        fi

        if use vulkan ; then
                # Install Vulkan driver
                unpack_deb "amdgpu-pro-16.60-379184/vulkan-amdgpu-pro_${PKG_VER_STRING}_amd64.deb"

                if use abi_x86_32 ; then
                        unpack_deb "amdgpu-pro-16.60-379184/vulkan-amdgpu-pro_${PKG_VER_STRING}_i386.deb"
                fi
        fi

        if use opengl ; then
                # Install OpenGL
                unpack_deb "amdgpu-pro-16.60-379184/libdrm-amdgpu-pro-amdgpu1_2.4.70-379184_amd64.deb"
                unpack_deb "amdgpu-pro-16.60-379184/libdrm-amdgpu-pro-radeon1_2.4.70-379184_amd64.deb"
                unpack_deb "amdgpu-pro-16.60-379184/libgl1-amdgpu-pro-glx_${PKG_VER_STRING}_amd64.deb"
                unpack_deb "amdgpu-pro-16.60-379184/libgl1-amdgpu-pro-ext_${PKG_VER_STRING}_amd64.deb"
                unpack_deb "amdgpu-pro-16.60-379184/libgl1-amdgpu-pro-dri_${PKG_VER_STRING}_amd64.deb"

                # Install GBM
                unpack_deb "amdgpu-pro-16.60-379184/libgbm1-amdgpu-pro_${PKG_VER_STRING}_amd64.deb"
                unpack_deb "amdgpu-pro-16.60-379184/libgbm1-amdgpu-pro-base_${PKG_VER_STRING}_all.deb"

                if use abi_x86_32 ; then
                        unpack_deb "amdgpu-pro-16.60-379184/libdrm-amdgpu-pro-amdgpu1_2.4.70-379184_i386.deb"
                        unpack_deb "amdgpu-pro-16.60-379184/libdrm-amdgpu-pro-radeon1_2.4.70-379184_i386.deb"
                        unpack_deb "amdgpu-pro-16.60-379184/libgl1-amdgpu-pro-glx_${PKG_VER_STRING}_i386.deb"
                        unpack_deb "amdgpu-pro-16.60-379184/libgl1-amdgpu-pro-dri_${PKG_VER_STRING}_i386.deb"

                        # Install GBM
                        unpack_deb "amdgpu-pro-16.60-379184/libgbm1-amdgpu-pro_${PKG_VER_STRING}_i386.deb"
                fi
        fi

        if use gles2 ; then
                # Install GLES2
                unpack_deb "amdgpu-pro-16.60-379184/libgles2-amdgpu-pro_${PKG_VER_STRING}_amd64.deb"

                if use abi_x86_32 ; then
                        unpack_deb "amdgpu-pro-16.60-379184/libgles2-amdgpu-pro_${PKG_VER_STRING}_i386.deb"
                fi
        fi

        # Install EGL libs
        unpack_deb "amdgpu-pro-16.60-379184/libegl1-amdgpu-pro_${PKG_VER_STRING}_amd64.deb"

        if use abi_x86_32 ; then
                unpack_deb "amdgpu-pro-16.60-379184/libegl1-amdgpu-pro_${PKG_VER_STRING}_i386.deb"
        fi

        if use vdpau ; then
                # Install VDPAU
                unpack_deb "amdgpu-pro-16.60-379184/libvdpau-amdgpu-pro_12.0.3-379184_amd64.deb"

                if use abi_x86_32 ; then
                        unpack_deb "amdgpu-pro-16.60-379184/libvdpau-amdgpu-pro_12.0.3-379184_i386.deb"
                fi
        fi

        # Install xorg drivers
        unpack_deb "amdgpu-pro-16.60-379184/xserver-xorg-video-amdgpu-pro_1.2.99-379184_amd64.deb"

        # Install gstreamer OpenMAX plugin
        unpack_deb "amdgpu-pro-16.60-379184/gst-omx-amdgpu-pro_1.0.0.1-379184_amd64.deb"
        if use abi_x86_32 ; then
                unpack_deb "amdgpu-pro-16.60-379184/gst-omx-amdgpu-pro_1.0.0.1-379184_i386.deb"
        fi
}

src_prepare() {
        cat << EOF > "${T}/91-drm_pro-modeset.rules" || die
KERNEL=="controlD[0-9]*", SUBSYSTEM=="drm", MODE="0600"
EOF

        cat << EOF > "${T}/01-amdgpu-pro.conf" || die
/usr/$(get_libdir)/gbm
/usr/lib32/gbm
EOF

        cat << EOF > "${T}/10-device.conf" || die
Section "Device"
        Identifier  "Sapphire AMD RX 480 Nitro+"
        Driver      "amdgpu"
        BusID       "PCI:1:0:0"
        Option      "AccelMethod" "glamor"
        Option      "DRI" "3"
        Option          "TearFree" "on"
EndSection
EOF

        cat << EOF > "${T}/10-screen.conf" || die
Section "Screen"
                Identifier      "Screen0"
                DefaultDepth    24
                SubSection      "Display"
                                Depth   24
                EndSubSection
EndSection
EOF

        cat << EOF > "${T}/10-monitor.conf" || die
Section "Monitor"
        Identifier   "Dell Ultrasharp"
        VendorName   "Dell, Inc."
        ModelName    "U2311H"
        Option       "DPMS"   "true"
EndSection
EOF

        if use vulkan ; then
                cat << EOF > "${T}/amd_icd64.json" || die
{
   "file_format_version": "1.0.0",
           "ICD": {
                   "library_path": "/usr/$(get_libdir)/vulkan/vendors/amdgpu-pro/amdvlk64.so",
                   "abi_versions": "0.9.0"
           }
}
EOF

                if use abi_x86_32 ; then
                        cat << EOF > "${T}/amd_icd32.json" || die
{
   "file_format_version": "1.0.0",
           "ICD": {
                   "library_path": "/usr/lib32/vulkan/vendors/amdgpu-pro/amdvlk32.so",
                   "abi_versions": "0.9.0"
           }
}
EOF
                fi
        fi

        eapply_user
}

src_install() {
        insinto /etc/udev/rules.d/
        doins "${T}/91-drm_pro-modeset.rules"
        insinto /etc/ld.so.conf.d
        doins "${T}/01-amdgpu-pro.conf"
        insinto /etc/X11/xorg.conf.d
        doins "${T}/10-screen.conf"
        doins "${T}/10-monitor.conf"
        doins "${T}/10-device.conf"
        insinto /etc/amd/
        doins etc/amd/amdapfxx.blb

        into /usr/
        cd opt/amdgpu-pro/bin/
        dobin amdgpu_test
        dobin kms-steal-crtc
        dobin kmstest
        dobin kms-universal-planes
        dobin modeprint
        dobin modetest
        dobin proptest
        dobin vbltest
        cd ../../..

        if use opencl ; then
                # Install clinfo
                into /usr/
                cd opt/amdgpu-pro/bin/
                dobin clinfo
                cd ../../..

                # Install the OpenCL ICD
                insinto /etc/OpenCL/vendors
                doins etc/OpenCL/vendors/amdocl64.icd
                exeinto /usr/lib64/OpenCL/vendors/amdgpu-pro
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/libamdocl*

                # Install OpenCL library
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/libOpenCL.so.1
                dosym libOpenCL.so.1 /usr/lib64/OpenCL/vendors/amdgpu-pro/libOpenCL.so

                if use abi_x86_32 ; then
                        # Install 32 bit OpenCL ICD
                        insinto /etc/OpenCL/vendors
                        doins etc/OpenCL/vendors/amdocl32.icd
                        exeinto /usr/lib32/OpenCL/vendors/amdgpu-pro
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/libamdocl*

                        # Install 32 bit OpenCL library
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/libOpenCL.so.1
                        dosym libOpenCL.so.1 /usr/lib32/OpenCL/vendors/amdgpu-pro/libOpenCL.so
                fi
        fi

        if use vulkan ; then
                # Install Vulkan driver
                insinto /etc/vulkan/icd.d
                doins "${T}/amd_icd64.json"
                exeinto /usr/lib64/vulkan/vendors/amdgpu-pro
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/amdvlk64.so

                if use abi_x86_32 ; then
                        # Install Vulkan driver
                        insinto /etc/vulkan/icd.d
                        doins "${T}/amd_icd32.json"
                        exeinto /usr/lib32/vulkan/vendors/amdgpu-pro
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/amdvlk32.so
                fi
        fi

        if use opengl ; then
                # Install OpenGL
                exeinto /usr/lib64/opengl/amdgpu-pro/lib
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/libdrm_amdgpu.so.1.0.0
                dosym libdrm_amdgpu.so.1.0.0 /usr/lib64/opengl/amdgpu-pro/lib/libdrm_amdgpu.so.1
                dosym libdrm_amdgpu.so.1.0.0 /usr/lib64/opengl/amdgpu-pro/lib/libdrm_amdgpu.so
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/libGL.so.1.2
                dosym libGL.so.1.2 /usr/lib64/opengl/amdgpu-pro/lib/libGL.so.1
                dosym libGL.so.1.2 /usr/lib64/opengl/amdgpu-pro/lib/libGL.so
                exeinto /usr/lib64/opengl/radeon/lib
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/libdrm_radeon.so.1.0.1
                dosym libdrm_radeon.so.1.0.1 /usr/lib64/opengl/radeon/lib/libdrm_radeon.so.1
                dosym libdrm_radeon.so.1.0.1 /usr/lib64/opengl/radeon/lib/libdrm_radeon.so
                insinto /etc/amd/
                doins etc/amd/amdrc
                exeinto /usr/lib64/opengl/amdgpu-pro/extensions
                doexe opt/amdgpu-pro/lib/xorg/modules/extensions/libglx.so
                exeinto /usr/lib64/opengl/amdgpu-pro/dri
                doexe usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so
                dosym ../opengl/amdgpu-pro/dri/amdgpu_dri.so /usr/lib64/dri/amdgpu_dri.so
                dosym ../../opengl/amdgpu-pro/dri/amdgpu_dri.so /usr/lib64/x86_64-linux-gnu/dri/amdgpu_dri.so

                # Install GBM
                exeinto /usr/lib64/opengl/amdgpu-pro/lib
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/libgbm.so.1.0.0
                dosym libgbm.so.1.0.0 /usr/lib64/opengl/amdgpu-pro/lib/libgbm.so.1
                dosym libgbm.so.1.0.0 /usr/lib64/opengl/amdgpu-pro/lib/libgbm.so
                exeinto /usr/lib64/opengl/amdgpu-pro/gbm
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/gbm/gbm_amdgpu.so
                dosym gbm_amdgpu.so /usr/lib64/opengl/amdgpu-pro/gbm/libdummy.so
                dosym opengl/amdgpu-pro/gbm /usr/lib64/gbm
                insinto /etc/gbm/
                doins etc/gbm/gbm.conf

                if use abi_x86_32 ; then
                        # Install 32 bit OpenGL
                        exeinto /usr/lib32/opengl/amdgpu-pro/lib
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/libdrm_amdgpu.so.1.0.0
                        dosym libdrm_amdgpu.so.1.0.0 /usr/lib32/opengl/amdgpu-pro/lib/libdrm_amdgpu.so.1
                        dosym libdrm_amdgpu.so.1.0.0 /usr/lib32/opengl/amdgpu-pro/lib/libdrm_amdgpu.so
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/libGL.so.1.2
                        dosym libGL.so.1.2 /usr/lib32/opengl/amdgpu-pro/lib/libGL.so.1
                        dosym libGL.so.1.2 /usr/lib32/opengl/amdgpu-pro/lib/libGL.so
                        exeinto /usr/lib32/opengl/radeon/lib
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/libdrm_radeon.so.1.0.1
                        dosym libdrm_radeon.so.1.0.1 /usr/lib32/opengl/radeon/lib/libdrm_radeon.so.1
                        dosym libdrm_radeon.so.1.0.1 /usr/lib32/opengl/radeon/lib/libdrm_radeon.so
                        exeinto /usr/lib32/opengl/amdgpu-pro/dri
                        doexe usr/lib/i386-linux-gnu/dri/amdgpu_dri.so
                        dosym ../opengl/amdgpu-pro/dri/amdgpu_dri.so /usr/lib32/dri/amdgpu_dri.so
                        dosym ../../opengl/amdgpu-pro/dri/amdgpu_dri.so /usr/lib64/i386-linux-gnu/dri/amdgpu_dri.so

                        # Install GBM
                        exeinto /usr/lib32/opengl/amdgpu-pro/lib
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/libgbm.so.1.0.0
                        dosym libgbm.so.1.0.0 /usr/lib32/opengl/amdgpu-pro/lib/libgbm.so.1
                        dosym libgbm.so.1.0.0 /usr/lib32/opengl/amdgpu-pro/lib/libgbm.so
                        exeinto /usr/lib32/opengl/amdgpu-pro/gbm
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/gbm/gbm_amdgpu.so
                        dosym gbm_amdgpu.so /usr/lib32/opengl/amdgpu-pro/gbm/libdummy.so
                        dosym opengl/amdgpu-pro/gbm /usr/lib32/gbm
                fi
        fi

        if use gles2 ; then
                # Install GLES2
                exeinto /usr/lib64/opengl/amdgpu-pro/lib
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/libGLESv2.so.2
                dosym libGLESv2.so.2 /usr/lib64/opengl/amdgpu-pro/lib/libGLESv2.so

                if use abi_x86_32 ; then
                        exeinto /usr/lib32/opengl/amdgpu-pro/lib
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/libGLESv2.so.2
                        dosym libGLESv2.so.2 /usr/lib32/opengl/amdgpu-pro/lib/libGLESv2.so
                fi
        fi

        # Install EGL libs
        exeinto /usr/lib64/opengl/amdgpu-pro/lib
        doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/libEGL.so.1
        dosym libEGL.so.1 /usr/lib64/opengl/amdgpu-pro/lib/libEGL.so

        if use abi_x86_32 ; then
                exeinto /usr/lib32/opengl/amdgpu-pro/lib
                doexe opt/amdgpu-pro/lib/i386-linux-gnu/libEGL.so.1
                dosym libEGL.so.1 /usr/lib32/opengl/amdgpu-pro/lib/libEGL.so
        fi

        if use vdpau ; then
                # Install VDPAU
                exeinto /usr/lib64/opengl/amdgpu-pro/vdpau/
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/vdpau/libvdpau_amdgpu.so.1.0.0
                dosym ../opengl/amdgpu-pro/vdpau/libvdpau_amdgpu.so.1.0.0 /usr/lib64/vdpau/libvdpau_amdgpu.so.1.0.0
                dosym libvdpau_amdgpu.so.1.0.0 /usr/lib64/vdpau/libvdpau_amdgpu.so.1.0
                dosym libvdpau_amdgpu.so.1.0.0 /usr/lib64/vdpau/libvdpau_amdgpu.so.1
                dosym libvdpau_amdgpu.so.1.0.0 /usr/lib64/vdpau/libvdpau_amdgpu.so
                exeinto /usr/lib64/opengl/amdgpu-pro/dri/
                doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
                if use abi_x86_32 ; then
                        exeinto /usr/lib32/opengl/amdgpu-pro/vdpau/
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/vdpau/libvdpau_amdgpu.so.1.0.0
                        dosym ../opengl/amdgpu-pro/vdpau/libvdpau_amdgpu.so.1.0.0 /usr/lib32/vdpau/libvdpau_amdgpu.so.1.0.0
                        dosym libvdpau_amdgpu.so.1.0.0 /usr/lib32/vdpau/libvdpau_amdgpu.so.1.0
                        dosym libvdpau_amdgpu.so.1.0.0 /usr/lib32/vdpau/libvdpau_amdgpu.so.1
                        dosym libvdpau_amdgpu.so.1.0.0 /usr/lib32/vdpau/libvdpau_amdgpu.so
                        exeinto /usr/lib32/opengl/amdgpu-pro/dri/
                        doexe opt/amdgpu-pro/lib/i386-linux-gnu/dri/radeonsi_drv_video.so
                fi
        fi

        # Install xorg drivers
        exeinto /usr/lib64/opengl/amdgpu-pro/modules/drivers
        doexe opt/amdgpu-pro/lib/xorg/modules/drivers/amdgpu_drv.so

        # Install gstreamer OpenMAX plugin
        insinto /etc/xdg/
        doins etc/xdg/gstomx.conf
        exeinto /usr/lib64/gstreamer-1.0/
        doexe opt/amdgpu-pro/lib/x86_64-linux-gnu/gstreamer-1.0/libgstomx.so
        if use abi_x86_32 ; then
                exeinto /usr/lib32/gstreamer-1.0/
                doexe opt/amdgpu-pro/lib/i386-linux-gnu/gstreamer-1.0/libgstomx.so
        fi
}

pkg_prerm() {
        einfo "pkg_prerm"
        if use opengl ; then
                "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
        fi

        if use opencl ; then
                "${ROOT}"/usr/bin/eselect opencl set --use-old mesa
        fi
}

pkg_postinst() {
        einfo "pkg_postinst"
        if use opengl ; then
                "${ROOT}"/usr/bin/eselect opengl set --use-old amdgpu-pro
        fi

        if use opencl ; then
                "${ROOT}"/usr/bin/eselect opencl set --use-old amdgpu-pro
        fi
}


Create the manifest (ebuild amdgpu-pro-16.60.379184.ebuild manifest), then install the driver (emerge amdgpu-pro). You can choose whatever use flags you want/need, they are self-explanatory.
Now, as root, create a directory in which you are going to extract the dkms code, patch it and compile it. For example
Code:
mkdir amdgpupro-16.60-379184_4.9.6-r1

Go there, copy the source in it and extract it:
Code:
cd amdgpupro-16.60-379184_4.9.6-r1
cp /usr/portage/distfiles/amdgpu-pro-16.60-379184.tar.xz .
tar xJf amdgpu-pro-16.60-379184.tar.xz
rm amdgpu-pro-16.60-379184.tar.xz
cd amdgpu-pro-16.60-379184/
ar x amdgpu-pro-dkms_16.60-379184_all.deb
tar xJf data.tar.xz
rm *
cd usr/src/

Now, inside this directory, you have the code for the module, which needs to be patched. To do so, apply the following 14 patches.

Patch1
Code:
--- ./Makefile.orig     2017-02-04 17:50:44.590873602 +0000
+++ ./Makefile  2017-02-04 17:51:24.699801106 +0000
@@ -24,8 +24,12 @@
 subdir-ccflags-y += -DOS_NAME_SLE
 else ifeq ("sles",$(OS_NAME))
 subdir-ccflags-y += -DOS_NAME_SLE
+else ifeq ("gentoo",$(OS_NAME))
+ccflags-y += -DOS_NAME_GENTOO
+OS_VERSION = "0.0"
 else
 subdir-ccflags-y += -DOS_NAME_UNKNOWN
+OS_VERSION = "0.0"
 endif
 
 subdir-ccflags-y += \


Patch2
Code:
--- ./amd/amdgpu/amdgpu_sa.c.orig       2017-02-04 20:02:18.685978657 +0000
+++ ./amd/amdgpu/amdgpu_sa.c    2017-02-04 20:03:03.004912073 +0000
@@ -427,13 +427,8 @@
                           soffset, eoffset, eoffset - soffset);
 
                if (i->fence)
-#if defined(BUILD_AS_DKMS)
-                       seq_printf(m, " protected by 0x%08x on context %d",
-                                  i->fence->seqno, i->fence->context);
-#else
                        seq_printf(m, " protected by 0x%08x on context %llu",
                                   i->fence->seqno, i->fence->context);
-#endif
 
                seq_printf(m, "\n");
        }


Patch3
Code:
--- ./amd/amdgpu/amdgpu_acp.c.orig      2017-02-04 20:23:57.443999798 +0000
+++ ./amd/amdgpu/amdgpu_acp.c   2017-02-04 20:25:43.681839596 +0000
@@ -438,7 +438,7 @@
         * hw and ACP-genpd status are in sync.
         * 'suspend_power_off' represents "Power status before system suspend"
        */
-       if (adev->acp.acp_genpd->gpd.suspend_power_off == true) {
+       if ((bool) adev->acp.acp_genpd->gpd.power_off == true) {
                apd = container_of(&adev->acp.acp_genpd->gpd,
                                        struct acp_pm_domain, gpd);
 


Patch4
Code:
--- ./amd/amdgpu/amdgpu_connectors.c.orig       2017-02-04 18:53:26.543626857 +0000
+++ ./amd/amdgpu/amdgpu_connectors.c    2017-02-04 18:54:21.598550151 +0000
@@ -168,12 +168,12 @@
                }
 
                /* Any defined maximum tmds clock limit we must not exceed? */
-               if (connector->max_tmds_clock > 0) {
+               if (connector->display_info.max_tmds_clock > 0) {
                        /* mode_clock is clock in kHz for mode to be modeset on this connector */
                        mode_clock = amdgpu_connector->pixelclock_for_modeset;
 
                        /* Maximum allowable input clock in kHz */
-                       max_tmds_clock = connector->max_tmds_clock * 1000;
+                       max_tmds_clock = connector->display_info.max_tmds_clock * 1000;
 
                        DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
                                  connector->name, mode_clock, max_tmds_clock);


Patch5
Code:
--- ./amd/amdgpu/amdgpu_gds.h.orig      2017-02-04 20:27:46.465655425 +0000
+++ ./amd/amdgpu/amdgpu_gds.h   2017-02-04 20:31:59.887306785 +0000
@@ -31,6 +31,15 @@
 #define AMDGPU_GWS_SHIFT       PAGE_SHIFT
 #define AMDGPU_OA_SHIFT                PAGE_SHIFT
 
+#define TTM_PL_PRIV0       (TTM_PL_PRIV + 0)
+#define TTM_PL_PRIV1       (TTM_PL_PRIV + 1)
+#define TTM_PL_PRIV2       (TTM_PL_PRIV + 2)
+
+#define TTM_PL_FLAG_PRIV0  (TTM_PL_FLAG_PRIV << 0)
+#define TTM_PL_FLAG_PRIV1  (TTM_PL_FLAG_PRIV << 1)
+#define TTM_PL_FLAG_PRIV2  (TTM_PL_FLAG_PRIV << 2)
+
+
 struct amdgpu_ring;
 struct amdgpu_bo;
 


Patch6
Code:
--- ./amd/amdgpu/amdgpu_ttm.c.orig      2017-02-04 20:03:27.837874831 +0000
+++ ./amd/amdgpu/amdgpu_ttm.c   2017-02-04 20:50:58.949728828 +0000
@@ -251,11 +251,15 @@
 
 static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp)
 {
+       struct drm_file *file_priv;
        struct amdgpu_bo *abo = container_of(bo, struct amdgpu_bo, tbo);
 
        if (amdgpu_ttm_tt_get_usermm(bo->ttm))
                return -EPERM;
-       return drm_vma_node_verify_access(&abo->gem_base.vma_node, filp);
+
+       file_priv = filp->private_data;
+
+       return drm_vma_node_verify_access(&abo->gem_base.vma_node, file_priv);
 }
 
 static void amdgpu_move_null(struct ttm_buffer_object *bo,


Patch7
Code:
--- ./amd/display/amdgpu_dm/amdgpu_dm_types.c.orig      2017-02-04 20:38:59.467731820 +0000
+++ ./amd/display/amdgpu_dm/amdgpu_dm_types.c   2017-02-04 20:41:09.783551471 +0000
@@ -913,7 +913,7 @@
 }
 
 static struct dc_target *create_target_for_sink(
-               const struct amdgpu_connector *aconnector,
+               struct amdgpu_connector *aconnector,
                const struct drm_display_mode *drm_mode,
                const struct dm_connector_state *dm_state)
 {
@@ -1811,8 +1811,8 @@
 }
 
 static const struct drm_plane_helper_funcs dm_plane_helper_funcs = {
-       .prepare_fb = dm_plane_helper_prepare_fb,
-       .cleanup_fb = dm_plane_helper_cleanup_fb,
+       .prepare_fb = (void*) dm_plane_helper_prepare_fb,
+       .cleanup_fb = (void*) dm_plane_helper_cleanup_fb,
 };
 
 /*


Patch8
Code:
--- ./amd/display/dc/dm_services.h.orig 2017-02-04 18:38:59.622935141 +0000
+++ ./amd/display/dc/dm_services.h      2017-02-04 18:42:13.380620133 +0000
@@ -61,13 +61,16 @@
 
 #if defined(CONFIG_DEBUG_KERNEL_DC)
 #define ASSERT(expr) ASSERT_CRITICAL(expr)
+#endif
 
 #else
 #define ASSERT(expr) WARN_ON(!(expr))
-#endif
-
 #define BREAK_TO_DEBUGGER() ASSERT(0)
-
+#define ASSERT_CRITICAL(expr) do { if (WARN_ON(!(expr))) { ; } } while (0)
 #endif /* CONFIG_DEBUG_KERNEL || CONFIG_DEBUG_DRIVER */
 
 #define DC_ERR(...)  do { \


Patch9
Code:
--- ./amd/dkms/Makefile.orig    2017-02-04 17:52:36.349691201 +0000
+++ ./amd/dkms/Makefile 2017-02-04 17:52:44.653679851 +0000
@@ -24,8 +24,12 @@
 subdir-ccflags-y += -DOS_NAME_SLE
 else ifeq ("sles",$(OS_NAME))
 subdir-ccflags-y += -DOS_NAME_SLE
+else ifeq ("gentoo",$(OS_NAME))
+ccflags-y += -DOS_NAME_GENTOO
+OS_VERSION = "0.0"
 else
 subdir-ccflags-y += -DOS_NAME_UNKNOWN
+OS_VERSION = "0.0"
 endif
 
 subdir-ccflags-y += \


Patch10
Code:
--- ./amd/dkms/dkms.conf.orig   2017-02-04 17:54:17.868568236 +0000
+++ ./amd/dkms/dkms.conf        2017-02-04 17:54:29.724555834 +0000
@@ -9,12 +9,12 @@
 
 BUILT_MODULE_NAME[0]="amdgpu"
 BUILT_MODULE_LOCATION[0]="amd/amdgpu"
-DEST_MODULE_LOCATION[0]="/updates"
+DEST_MODULE_LOCATION[0]="/extra"
 
 BUILT_MODULE_NAME[1]="amdttm"
 BUILT_MODULE_LOCATION[1]="ttm"
-DEST_MODULE_LOCATION[1]="/updates"
+DEST_MODULE_LOCATION[1]="/extra"
 
 BUILT_MODULE_NAME[2]="amdkcl"
 BUILT_MODULE_LOCATION[2]="amd/amdkcl"
-DEST_MODULE_LOCATION[2]="/updates"
+DEST_MODULE_LOCATION[2]="/extra"


Patch11
Code:
--- ./amd/dkms/pre-build.sh.orig        2017-02-04 17:49:23.360051482 +0000
+++ ./amd/dkms/pre-build.sh     2017-02-04 17:49:30.239034551 +0000
@@ -27,7 +27,7 @@
 
 echo '// auto generated by DKMS pre-build.sh' > amd/amdkcl/symbols.c
 for sym in $SYMS; do
-    addr=$(grep "\<$sym\>" /boot/System.map-$KERNELVER | awk -F' ' '{print $1}')
+    addr=$(grep "\<$sym\>" /boot/System.map*-$KERNELVER | awk -F' ' '{print $1}')
     echo "void *_kcl_$sym = (void *)0x$addr;" >> amd/amdkcl/symbols.c
 done
 


Patch12
Code:
--- ./include/kcl/kcl_mm.h.orig 2017-02-04 18:49:16.081980547 +0000
+++ ./include/kcl/kcl_mm.h      2017-02-04 18:50:56.335837851 +0000
@@ -8,7 +8,15 @@
                                      int write, int force, struct page **pages,
                                      struct vm_area_struct **vmas)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+               unsigned int gup_flags = 0;
+               if (write)
+                               gup_flags |= FOLL_WRITE;
+               if (force)
+                               gup_flags |= FOLL_FORCE;
+
+               return get_user_pages(start, nr_pages, gup_flags, pages, vmas);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
         return get_user_pages(start, nr_pages, write, force, pages, vmas);
 #else
         return get_user_pages(tsk, mm, start, nr_pages,


Patch13
Code:
--- ./dkms.conf.orig    2017-02-04 17:53:03.981654410 +0000
+++ ./dkms.conf 2017-02-04 17:53:52.300596239 +0000
@@ -9,13 +9,13 @@
 
 BUILT_MODULE_NAME[0]="amdgpu"
 BUILT_MODULE_LOCATION[0]="amd/amdgpu"
-DEST_MODULE_LOCATION[0]="/updates"
+DEST_MODULE_LOCATION[0]="/extra"
 
 BUILT_MODULE_NAME[1]="amdttm"
 BUILT_MODULE_LOCATION[1]="ttm"
-DEST_MODULE_LOCATION[1]="/updates"
+DEST_MODULE_LOCATION[1]="/extra"
 
 BUILT_MODULE_NAME[2]="amdkcl"
 BUILT_MODULE_LOCATION[2]="amd/amdkcl"
-DEST_MODULE_LOCATION[2]="/updates"
+DEST_MODULE_LOCATION[2]="/extra"
 POST_REMOVE="post-remove.sh $kernelver"


Patch14
Code:
--- ./pre-build.sh.orig 2017-02-04 17:48:36.656177206 +0000
+++ ./pre-build.sh      2017-02-04 17:48:51.823134212 +0000
@@ -27,7 +27,7 @@
 
 echo '// auto generated by DKMS pre-build.sh' > amd/amdkcl/symbols.c
 for sym in $SYMS; do
-    addr=$(grep "\<$sym\>" /boot/System.map-$KERNELVER | awk -F' ' '{print $1}')
+    addr=$(grep "\<$sym\>" /boot/System.map*-$KERNELVER | awk -F' ' '{print $1}')
     echo "void *_kcl_$sym = (void *)0x$addr;" >> amd/amdkcl/symbols.c
 done


Then, install the module:
Code:
dkms install amdgpu-pro-16.60-379184

The compilation and installation should complete without errors. If there are errors, make sure you applied all the patches correctly.

Then, finally, reboot and enjoy your new card. :D



By the way, if anyone would like to turn this long post into a proper guide, gentoo wiki article or whatever, please do it, because I most likely won't have time for it.


Last edited by paraw on Mon Apr 03, 2017 2:09 pm; edited 4 times in total
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Wed Mar 15, 2017 12:17 am    Post subject: Reply with quote

Well, you are a genius.

Tomorrow I try it.


Thanks for that guide!
_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Wed Mar 15, 2017 3:03 pm    Post subject: Reply with quote

well, I try, but dont work dkms...

thats with kernel 4.8.17, vanilla
http://pastebin.com/yKJbsRP9
thats with gentoo-sources 4.9.6-r1
http://pastebin.com/nPFp3qwc
_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Wed Mar 15, 2017 7:21 pm    Post subject: Reply with quote

Sorry, I somehow copypasted patch 8 wrongly.
Remove the module sources with
dkms remove amdgpu-pro/16.60.379184 --all
Then, as root, do
Code:
cd amdgpupro-16.60-379184_4.9.6-r1/amdgpu-pro-16.60-379184/usr/src/amdgpu-pro-16.60-379184/amd/display/dc/

Edit the file dm_services.h, and find the line containing "#define ASSERT_CRITICAL(expr) do { \"
In that line and in the 3 following lines, remove the space at the end of the lines, after the backslash.
Save, exit, then go back to the root of the dkms source with
Code:
cd ../../../../

and try installing the module again.

Please write again and tell me if it works or if it doesn't.

In the meantime, I'll fix the patches in my previous message.
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Wed Mar 15, 2017 7:27 pm    Post subject: Reply with quote

Oh... OK, it wasn't me. 8)
It looks like when you copy the code from the forum, it adds a space at the end of the lines... that's not good, it shouldn't be there.
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Wed Mar 15, 2017 8:01 pm    Post subject: Reply with quote

Thats a problem but was solved previously. I noticed that before, but it dont work...

I can try with any kernel and same error.
I can compile dkms with amdgpu-pro-dkms provided in farmboy0 overlay and vulkan overlay from lucretia, but I cannot do it with that patch that you provide.

The only I manage to do now is use mesa and libdrm from gentoo native overlay, and radeonsi videocards that was previously disabled when I use the lucretia vulkan overlay and his provided mesa package and drm.

Now I can boot with eselect opengl set amdgpu-pro, previously I cannot, but same errors, vulkan dont work for dota2 for example, and same glxinfo/glxgears error.

thats my vulkaninfo

http://pastebin.com/bsSjTWxa

thats the output of dkms install....

Code:
DKMS make.log for amdgpu-pro-16.60-379184 for kernel 4.9.6-gentoo-r1-pelo (x86_64)
mié mar 15 16:48:17 ART 2017
make: se entra en el directorio '/usr/src/linux-4.9.6-gentoo-r1'
  LD      /var/lib/dkms/amdgpu-pro/16.60-379184/build/built-in.o
  LD      /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/built-in.o
  CC [M]  /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/amdgpu_drv.o
In file included from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/modules/inc/mod_freesync.h:57:0,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../amdgpu/amdgpu_mode.h:48,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../amdgpu/amdgpu.h:50,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../backport/include/kcl/kcl_amdgpu.h:5,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../backport/backport.h:5,
                 from <línea-de-orden>:0:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/dc/dm_services.h: En la función ‘dm_read_reg_func’:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/dc/dm_services.h:111:3: error: declaración implícita de la función ‘ASSERT’ [-Werror=implicit-function-declaration]
   DC_ERR("invalid register read. address = 0");
   ^
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/dc/dm_services.h: En el nivel principal:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/dc/dm_services.h:429:2: error: #endif sin #if
 #endif /* __DM_SERVICES_H__ */
  ^
In file included from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../amdgpu/amdgpu_ttm.h:27:0,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../amdgpu/amdgpu.h:54,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../backport/include/kcl/kcl_amdgpu.h:5,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../backport/backport.h:5,
                 from <línea-de-orden>:0:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../scheduler/gpu_scheduler.h:27:49: error: operator '==' has no left operand
 #if (defined OS_NAME_RHEL) && (OS_VERSION_MAJOR == 6)
                                                 ^
In file included from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../backport/backport.h:11:0,
                 from <línea-de-orden>:0:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/include/kcl/kcl_acpi.h:8:49: error: operator '<=' has no left operand
 #if (defined OS_NAME_RHEL) && (OS_VERSION_MAJOR <= 6)
                                                 ^
In file included from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../backport/backport.h:12:0,
                 from <línea-de-orden>:0:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/include/kcl/kcl_hwmon.h: En la función ‘kcl_hwmon_device_register_with_groups’:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/include/kcl/kcl_hwmon.h:15:49: error: operator '<=' has no left operand
 #if (defined OS_NAME_RHEL) && (OS_VERSION_MAJOR <= 6)
                                                 ^
cc1: algunos avisos se tratan como errores
make[2]: *** [scripts/Makefile.build:294: /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/amdgpu_drv.o] Error 1
make[1]: *** [scripts/Makefile.build:544: /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu] Error 2
make: *** [Makefile:1490: _module_/var/lib/dkms/amdgpu-pro/16.60-379184/build] Error 2
make: se sale del directorio '/usr/src/linux-4.9.6-gentoo-r1'


[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]
_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Wed Mar 15, 2017 9:56 pm    Post subject: Reply with quote

Sorry, but there is something I really do not understand here. What do you have in /etc/os-release?
It looks like the build system believes you are running Red Hat Enterprise Linux...

Also, did you actually fix dm_services.h? I note you have an error #endif sin #if
After fixing the file, you need to remove the module (dkms remove amdgpu-pro/16.60.379184 --all) before trying to reinstall it, otherwise dkms does not copy over the fixed code into the local build environment.
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Wed Mar 15, 2017 11:51 pm    Post subject: Reply with quote

paraw wrote:
Sorry, but there is something I really do not understand here. What do you have in /etc/os-release?
It looks like the build system believes you are running Red Hat Enterprise Linux...

Also, did you actually fix dm_services.h? I note you have an error #endif sin #if
After fixing the file, you need to remove the module (dkms remove amdgpu-pro/16.60.379184 --all) before trying to reinstall it, otherwise dkms does not copy over the fixed code into the local build environment.


Code:
pelo-pc src # cat /etc/os-release
NAME=Gentoo
ID=gentoo
PRETTY_NAME="Gentoo/Linux"
ANSI_COLOR="1;32"
HOME_URL="https://www.gentoo.org/"
SUPPORT_URL="https://www.gentoo.org/support/"
BUG_REPORT_URL="https://bugs.gentoo.org/"


I make all .patch files, use a base ebuild and did my overlay.
I found some spaces in patch files so I copy twice the src, modify all files with the patch, then with diff make my own patches, and thats the result, maybe there is some spaces that give me the error.
tomorrow I will do the work again, so if I can make all ebuilds, we can have a working overlay

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]
_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Thu Mar 16, 2017 12:11 pm    Post subject: Reply with quote

well, I build all patches again, checked all spaces and the problem is in dm_services.h

here is the log

Code:
pelo-pc linux # cat /var/lib/dkms/amdgpu-pro/16.60-379184/build/make.log
DKMS make.log for amdgpu-pro-16.60-379184 for kernel 4.9.6-gentoo-r1-pelo (x86_64)
jue mar 16 09:09:45 ART 2017
make: se entra en el directorio '/usr/src/linux-4.9.6-gentoo-r1'
  LD      /var/lib/dkms/amdgpu-pro/16.60-379184/build/built-in.o
  LD      /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/built-in.o
  CC [M]  /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/amdgpu_drv.o
In file included from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/modules/inc/mod_freesync.h:57:0,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../amdgpu/amdgpu_mode.h:48,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../amdgpu/amdgpu.h:50,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../backport/include/kcl/kcl_amdgpu.h:5,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../backport/backport.h:5,
                 from <línea-de-orden>:0:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/dc/dm_services.h: En la función ‘dm_read_reg_func’:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/dc/dm_services.h:105:3: error: declaración implícita de la función ‘BREAK_TO_DEBUGGER’ [-Werror=implicit-function-declaration]
   DC_ERR("invalid register read. address = 0");
   ^
cc1: algunos avisos se tratan como errores
make[2]: *** [scripts/Makefile.build:294: /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/amdgpu_drv.o] Error 1
make[1]: *** [scripts/Makefile.build:544: /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu] Error 2
make: *** [Makefile:1490: _module_/var/lib/dkms/amdgpu-pro/16.60-379184/build] Error 2
make: se sale del directorio '/usr/src/linux-4.9.6-gentoo-r1'




thanks for your help



I think my problem is kernel configuration...
Can you share your .config?
_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Thu Mar 16, 2017 12:57 pm    Post subject: Reply with quote

Your problem is not kernel configuration. The point is that the AMD code would normally only work with a debug kernel, but patch 8 should take care of that. Can you please check your dm_services.h file? In particular, lines 46 to 72 must look like this
Code:
#if defined(CONFIG_DEBUG_KERNEL) || defined(CONFIG_DEBUG_DRIVER)

#if defined(CONFIG_HAVE_KGDB) || defined(CONFIG_KGDB)
#define ASSERT_CRITICAL(expr) do {  \
    if (WARN_ON(!(expr))) { \
        kgdb_breakpoint(); \
    } \
} while (0)
#else
#define ASSERT_CRITICAL(expr) do {  \
    if (WARN_ON(!(expr))) { \
        ; \
    } \
} while (0)
#endif

#if defined(CONFIG_DEBUG_KERNEL_DC)
#define ASSERT(expr) ASSERT_CRITICAL(expr)
#endif

#else
#define ASSERT(expr) WARN_ON(!(expr))

#define BREAK_TO_DEBUGGER() ASSERT(0)
#define ASSERT_CRITICAL(expr) do { if (WARN_ON(!(expr))) { ; } } while (0)

#endif /* CONFIG_DEBUG_KERNEL || CONFIG_DEBUG_DRIVER */


You see, the last few lines take care of exactly this problem. The #else on line 66 refers to the if on line 46. So, if your kernel is not a debug kernel, it defines ASSERT and defines BREAK_TO DEBUGGER (lines 67 and 69, respectively). Really, that's it. If your file is exactly as I posted above, then you must check that you have the right local copy of the code in the dkms.

Let me explain. When you do dkms install, dkms copies the code into a local location, which is /var/lib/dkms/amdgpu-pro/16.60-379184/. After that, if you change some file where you unpacked the sources and do again dkms install, these changes are not propagated. This means that you would still be compiling the old code. To fix this, you have to first remove the module with
Code:
dkms remove amdgpu-pro/16.60.379184 --all

and then install it again with dmks install as above.
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Thu Mar 16, 2017 1:25 pm    Post subject: Reply with quote

paraw wrote:
Your problem is not kernel configuration. The point is that the AMD code would normally only work with a debug kernel, but patch 8 should take care of that. Can you please check your dm_services.h file? In particular, lines 46 to 72 must look like this
Code:
#if defined(CONFIG_DEBUG_KERNEL) || defined(CONFIG_DEBUG_DRIVER)

#if defined(CONFIG_HAVE_KGDB) || defined(CONFIG_KGDB)
#define ASSERT_CRITICAL(expr) do {  \
    if (WARN_ON(!(expr))) { \
        kgdb_breakpoint(); \
    } \
} while (0)
#else
#define ASSERT_CRITICAL(expr) do {  \
    if (WARN_ON(!(expr))) { \
        ; \
    } \
} while (0)
#endif

#if defined(CONFIG_DEBUG_KERNEL_DC)
#define ASSERT(expr) ASSERT_CRITICAL(expr)
#endif

#else
#define ASSERT(expr) WARN_ON(!(expr))

#define BREAK_TO_DEBUGGER() ASSERT(0)
#define ASSERT_CRITICAL(expr) do { if (WARN_ON(!(expr))) { ; } } while (0)

#endif /* CONFIG_DEBUG_KERNEL || CONFIG_DEBUG_DRIVER */


You see, the last few lines take care of exactly this problem. The #else on line 66 refers to the if on line 46. So, if your kernel is not a debug kernel, it defines ASSERT and defines BREAK_TO DEBUGGER (lines 67 and 69, respectively). Really, that's it. If your file is exactly as I posted above, then you must check that you have the right local copy of the code in the dkms.

Let me explain. When you do dkms install, dkms copies the code into a local location, which is /var/lib/dkms/amdgpu-pro/16.60-379184/. After that, if you change some file where you unpacked the sources and do again dkms install, these changes are not propagated. This means that you would still be compiling the old code. To fix this, you have to first remove the module with
Code:
dkms remove amdgpu-pro/16.60.379184 --all

and then install it again with dmks install as above.



the lines are as you post...

there is another mistake, I dont where it is, my coding skills are tooo amateur

Code:
pelo-pc src # dkms remove amdgpu-pro/16.60.379184 --all
Error! There are no instances of module: amdgpu-pro
16.60.379184 located in the DKMS tree.
pelo-pc src # rm -rf /var/lib/dkms/
amdgpu-pro/     dkms_dbversion 
pelo-pc src # rm -rf /var/lib/dkms/amdgpu-pro/
16.60-379184/               16.60-379184_4.9.6-r1-pelo/ original_module/           
pelo-pc src # rm -rf /var/lib/dkms/amdgpu-pro/*
pelo-pc src # dkms install -m amdgpu-pro -v 16.60-379184 -k 4.9.6-gentoo-r1-pelo

Creating symlink /var/lib/dkms/amdgpu-pro/16.60-379184/source ->
                 /usr/src/amdgpu-pro-16.60-379184

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Running the pre_build script:

Building module:
cleaning build area....
make KERNELRELEASE=4.9.6-gentoo-r1-pelo -C /lib/modules/4.9.6-gentoo-r1-pelo/build M=/var/lib/dkms/amdgpu-pro/16.60-379184/build....(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.9.6-gentoo-r1-pelo (x86_64)
Consult /var/lib/dkms/amdgpu-pro/16.60-379184/build/make.log for more information.
pelo-pc src # cat /var/lib/dkms/amdgpu-pro/16.60-379184/build/make.log
DKMS make.log for amdgpu-pro-16.60-379184 for kernel 4.9.6-gentoo-r1-pelo (x86_64)
jue mar 16 10:11:30 ART 2017
make: se entra en el directorio '/usr/src/linux-4.9.6-gentoo-r1'
  LD      /var/lib/dkms/amdgpu-pro/16.60-379184/build/built-in.o
  LD      /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/built-in.o
  CC [M]  /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/amdgpu_drv.o
In file included from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/modules/inc/mod_freesync.h:57:0,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../amdgpu/amdgpu_mode.h:48,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../amdgpu/amdgpu.h:50,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../backport/include/kcl/kcl_amdgpu.h:5,
                 from /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../backport/backport.h:5,
                 from <línea-de-orden>:0:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/dc/dm_services.h: En la función ‘dm_read_reg_func’:
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/../display/dc/dm_services.h:107:3: error: declaración implícita de la función ‘BREAK_TO_DEBUGGER’ [-Werror=implicit-function-declaration]
   DC_ERR("invalid register read. address = 0");
   ^
cc1: algunos avisos se tratan como errores
make[2]: *** [scripts/Makefile.build:294: /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu/amdgpu_drv.o] Error 1
make[1]: *** [scripts/Makefile.build:544: /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/amdgpu] Error 2
make: *** [Makefile:1490: _module_/var/lib/dkms/amdgpu-pro/16.60-379184/build] Error 2
make: se sale del directorio '/usr/src/linux-4.9.6-gentoo-r1'



Code:
pelo-pc src # cat /var/lib/dkms/amdgpu-pro/16.60-379184/source/amd/display/dc/dm_services.h
/*
 * Copyright 2015 Advanced Micro Devices, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors: AMD
 *
 */

/**
 * This file defines external dependencies of Display Core.
 */

#ifndef __DM_SERVICES_H__

#define __DM_SERVICES_H__

/* TODO: remove when DC is complete. */
#include "dm_services_types.h"
#include "logger_interface.h"
#include "link_service_types.h"

#undef DEPRECATED

/*
 *
 * general debug capabilities
 *
 */
#if defined(CONFIG_DEBUG_KERNEL) || defined(CONFIG_DEBUG_DRIVER)

#if defined(CONFIG_HAVE_KGDB) || defined(CONFIG_KGDB)
#define ASSERT_CRITICAL(expr) do {      \
        if (WARN_ON(!(expr))) { \
                kgdb_breakpoint(); \
        } \
} while (0)
#else
#define ASSERT_CRITICAL(expr) do {      \
        if (WARN_ON(!(expr))) { \
                ; \
        } \
} while (0)
#endif

#if defined(CONFIG_DEBUG_KERNEL_DC)
#define ASSERT(expr) ASSERT_CRITICAL(expr)
#endif

#else
#define ASSERT(expr) WARN_ON(!(expr))

#define BREAK_TO_DEBUGGER() ASSERT(0)
#define ASSERT_CRITICAL(expr) do { if (WARN_ON(!(expr))) { ; } } while (0)

#endif /* CONFIG_DEBUG_KERNEL || CONFIG_DEBUG_DRIVER */

#define DC_ERR(...)  do { \
        dm_error(__VA_ARGS__); \
        BREAK_TO_DEBUGGER(); \
} while (0)

#define dm_alloc(size) kzalloc(size, GFP_KERNEL)
#define dm_realloc(ptr, size) krealloc(ptr, size, GFP_KERNEL)
#define dm_free(ptr) kfree(ptr)

irq_handler_idx dm_register_interrupt(
        struct dc_context *ctx,
        struct dc_interrupt_params *int_params,
        interrupt_handler ih,
        void *handler_args);


/*
 *
 * GPU registers access
 *
 */

#define dm_read_reg(ctx, address)       \
                dm_read_reg_func(ctx, address, __func__)

static inline uint32_t dm_read_reg_func(
        const struct dc_context *ctx,
        uint32_t address,
        const char *func_name)
{
        uint32_t value;

        if (address == 0) {
                DC_ERR("invalid register read. address = 0");
                return 0;
        }

        value = cgs_read_register(ctx->cgs_device, address);

#if defined(__DAL_REGISTER_LOGGER__)
        if (true == dal_reg_logger_should_dump_register()) {
                dal_reg_logger_rw_count_increment();
                DRM_INFO("%s DC_READ_REG: 0x%x 0x%x\n", func_name, address, value);
        }
#endif
        return value;
}

#define dm_write_reg(ctx, address, value)       \
        dm_write_reg_func(ctx, address, value, __func__)

static inline void dm_write_reg_func(
        const struct dc_context *ctx,
        uint32_t address,
        uint32_t value,
        const char *func_name)
{
#if defined(__DAL_REGISTER_LOGGER__)
        if (true == dal_reg_logger_should_dump_register()) {
                dal_reg_logger_rw_count_increment();
                DRM_INFO("%s DC_WRITE_REG: 0x%x 0x%x\n", func_name, address, value);
        }
#endif

        if (address == 0) {
                DC_ERR("invalid register write. address = 0");
                return;
        }
        cgs_write_register(ctx->cgs_device, address, value);
}

static inline uint32_t dm_read_index_reg(
        const struct dc_context *ctx,
        enum cgs_ind_reg addr_space,
        uint32_t index)
{
        return cgs_read_ind_register(ctx->cgs_device, addr_space, index);
}

static inline void dm_write_index_reg(
        const struct dc_context *ctx,
        enum cgs_ind_reg addr_space,
        uint32_t index,
        uint32_t value)
{
        cgs_write_ind_register(ctx->cgs_device, addr_space, index, value);
}

static inline uint32_t get_reg_field_value_ex(
        uint32_t reg_value,
        uint32_t mask,
        uint8_t shift)
{
        return (mask & reg_value) >> shift;
}

#define get_reg_field_value(reg_value, reg_name, reg_field)\
        get_reg_field_value_ex(\
                (reg_value),\
                reg_name ## __ ## reg_field ## _MASK,\
                reg_name ## __ ## reg_field ## __SHIFT)

static inline uint32_t set_reg_field_value_ex(
        uint32_t reg_value,
        uint32_t value,
        uint32_t mask,
        uint8_t shift)
{
        return (reg_value & ~mask) | (mask & (value << shift));
}

#define set_reg_field_value(reg_value, value, reg_name, reg_field)\
        (reg_value) = set_reg_field_value_ex(\
                (reg_value),\
                (value),\
                reg_name ## __ ## reg_field ## _MASK,\
                reg_name ## __ ## reg_field ## __SHIFT)

uint32_t generic_reg_update_ex(const struct dc_context *ctx,
                uint32_t addr, uint32_t reg_val, int n,
                uint8_t shift1, uint32_t mask1, uint32_t field_value1, ...);

#define FD(reg_field)   reg_field ## __SHIFT, \
                                                reg_field ## _MASK

/*
 * return number of poll before condition is met
 * return 0 if condition is not meet after specified time out tries
 */
unsigned int generic_reg_wait(const struct dc_context *ctx,
        uint32_t addr, uint32_t mask, uint32_t shift, uint32_t condition_value,
        unsigned int delay_between_poll_us, unsigned int time_out_num_tries,
        const char *func_name);

/**************************************
 * Power Play (PP) interfaces
 **************************************/

/* DAL calls this function to notify PP about clocks it needs for the Mode Set.
 * This is done *before* it changes DCE clock.
 *
 * If required clock is higher than current, then PP will increase the voltage.
 *
 * If required clock is lower than current, then PP will defer reduction of
 * voltage until the call to dc_service_pp_post_dce_clock_change().
 *
 * \input - Contains clocks needed for Mode Set.
 *
 * \output - Contains clocks adjusted by PP which DAL should use for Mode Set.
 *              Valid only if function returns zero.
 *
 * \returns     true - call is successful
 *              false - call failed
 */
bool dm_pp_pre_dce_clock_change(
        struct dc_context *ctx,
        struct dm_pp_gpu_clock_range *requested_state,
        struct dm_pp_gpu_clock_range *actual_state);

/* The returned clocks range are 'static' system clocks which will be used for
 * mode validation purposes.
 *
 * \returns     true - call is successful
 *              false - call failed
 */
bool dc_service_get_system_clocks_range(
        const struct dc_context *ctx,
        struct dm_pp_gpu_clock_range *sys_clks);

/* Gets valid clocks levels from pplib
 *
 * input: clk_type - display clk / sclk / mem clk
 *
 * output: array of valid clock levels for given type in ascending order,
 * with invalid levels filtered out
 *
 */
bool dm_pp_get_clock_levels_by_type(
        const struct dc_context *ctx,
        enum dm_pp_clock_type clk_type,
        struct dm_pp_clock_levels *clk_level_info);

bool dm_pp_get_clock_levels_by_type_with_latency(
        const struct dc_context *ctx,
        enum dm_pp_clock_type clk_type,
        struct dm_pp_clock_levels_with_latency *clk_level_info);

bool dm_pp_get_clock_levels_by_type_with_voltage(
        const struct dc_context *ctx,
        enum dm_pp_clock_type clk_type,
        struct dm_pp_clock_levels_with_voltage *clk_level_info);

bool dm_pp_notify_wm_clock_changes(
        const struct dc_context *ctx,
        struct dm_pp_wm_sets_with_clock_ranges *wm_with_clock_ranges);

/* DAL calls this function to notify PP about completion of Mode Set.
 * For PP it means that current DCE clocks are those which were returned
 * by dc_service_pp_pre_dce_clock_change(), in the 'output' parameter.
 *
 * If the clocks are higher than before, then PP does nothing.
 *
 * If the clocks are lower than before, then PP reduces the voltage.
 *
 * \returns     true - call is successful
 *              false - call failed
 */
bool dm_pp_apply_display_requirements(
        const struct dc_context *ctx,
        const struct dm_pp_display_configuration *pp_display_cfg);

bool dm_pp_apply_power_level_change_request(
        const struct dc_context *ctx,
        struct dm_pp_power_level_change_request *level_change_req);

bool dm_pp_apply_clock_for_voltage_request(
        const struct dc_context *ctx,
        struct dm_pp_clock_for_voltage_req *clock_for_voltage_req);

bool dm_pp_get_static_clocks(
        const struct dc_context *ctx,
        struct dm_pp_static_clock_info *static_clk_info);

/****** end of PP interfaces ******/

enum platform_method {
        PM_GET_AVAILABLE_METHODS = 1 << 0,
        PM_GET_LID_STATE = 1 << 1,
        PM_GET_EXTENDED_BRIGHNESS_CAPS = 1 << 2
};

struct platform_info_params {
        enum platform_method method;
        void *data;
};

struct platform_info_brightness_caps {
        uint8_t ac_level_percentage;
        uint8_t dc_level_percentage;
};

struct platform_info_ext_brightness_caps {
        struct platform_info_brightness_caps basic_caps;
        struct data_point {
                uint8_t luminance;
                uint8_t signal_level;
        } data_points[99];

        uint8_t data_points_num;
        uint8_t min_input_signal;
        uint8_t max_input_signal;
};

bool dm_get_platform_info(
        struct dc_context *ctx,
        struct platform_info_params *params);

struct persistent_data_flag {
        bool save_per_link;
        bool save_per_edid;
};

/* Call to write data in registry editor for persistent data storage.
 *
 * \inputs      sink - identify edid/link for registry folder creation
 *              module name - identify folders for registry
 *              key name - identify keys within folders for registry
 *              params - value to write in defined folder/key
 *              size - size of the input params
 *              flag - determine whether to save by link or edid
 *
 * \returns     true - call is successful
 *              false - call failed
 *
 * sink         module         key
 * -----------------------------------------------------------------------------
 * NULL         NULL           NULL     - failure
 * NULL         NULL           -        - create key with param value
 *                                                      under base folder
 * NULL         -              NULL     - create module folder under base folder
 * -            NULL           NULL     - failure
 * NULL         -              -        - create key under module folder
 *                                            with no edid/link identification
 * -            NULL           -        - create key with param value
 *                                                       under base folder
 * -            -              NULL     - create module folder under base folder
 * -            -              -        - create key under module folder
 *                                              with edid/link identification
 */
bool dm_write_persistent_data(struct dc_context *ctx,
                const struct dc_sink *sink,
                const char *module_name,
                const char *key_name,
                void *params,
                unsigned int size,
                struct persistent_data_flag *flag);


/* Call to read data in registry editor for persistent data storage.
 *
 * \inputs      sink - identify edid/link for registry folder creation
 *              module name - identify folders for registry
 *              key name - identify keys within folders for registry
 *              size - size of the output params
 *              flag - determine whether it was save by link or edid
 *
 * \returns     params - value read from defined folder/key
 *              true - call is successful
 *              false - call failed
 *
 * sink         module         key
 * -----------------------------------------------------------------------------
 * NULL         NULL           NULL     - failure
 * NULL         NULL           -        - read key under base folder
 * NULL         -              NULL     - failure
 * -            NULL           NULL     - failure
 * NULL         -              -        - read key under module folder
 *                                             with no edid/link identification
 * -            NULL           -        - read key under base folder
 * -            -              NULL     - failure
 * -            -              -        - read key under module folder
 *                                              with edid/link identification
 */
bool dm_read_persistent_data(struct dc_context *ctx,
                const struct dc_sink *sink,
                const char *module_name,
                const char *key_name,
                void *params,
                unsigned int size,
                struct persistent_data_flag *flag);

void dm_delay_in_microseconds
        (struct dc_context *ctx, unsigned int microSeconds);

bool dm_query_extended_brightness_caps
        (struct dc_context *ctx, enum dm_acpi_display_type display,
                        struct dm_acpi_atif_backlight_caps *pCaps);

bool dm_dmcu_set_pipe(struct dc_context *ctx, unsigned int controller_id);

/*
 *
 * print-out services
 *
 */
#define dm_log_to_buffer(buffer, size, fmt, args)\
        vsnprintf(buffer, size, fmt, args)

long dm_get_pid(void);
long dm_get_tgid(void);

#endif /* __DM_SERVICES_H__ */

_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Thu Mar 16, 2017 1:59 pm    Post subject: Reply with quote

Mmm... can you tell me what is in
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/display/dc/dm_services.h
please?
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Thu Mar 16, 2017 2:49 pm    Post subject: Reply with quote

paraw wrote:
Mmm... can you tell me what is in
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/display/dc/dm_services.h
please?


there is a quote in the previous post, I post it...

EDIT: sorry, wrong path, here it it

Code:
pelo-pc portagemio # cat /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/display/dc/dm_services.h
/*
 * Copyright 2015 Advanced Micro Devices, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors: AMD
 *
 */

/**
 * This file defines external dependencies of Display Core.
 */

#ifndef __DM_SERVICES_H__

#define __DM_SERVICES_H__

/* TODO: remove when DC is complete. */
#include "dm_services_types.h"
#include "logger_interface.h"
#include "link_service_types.h"

#undef DEPRECATED

/*
 *
 * general debug capabilities
 *
 */
#if defined(CONFIG_DEBUG_KERNEL) || defined(CONFIG_DEBUG_DRIVER)

#if defined(CONFIG_HAVE_KGDB) || defined(CONFIG_KGDB)
#define ASSERT_CRITICAL(expr) do {      \
        if (WARN_ON(!(expr))) { \
                kgdb_breakpoint(); \
        } \
} while (0)
#else
#define ASSERT_CRITICAL(expr) do {      \
        if (WARN_ON(!(expr))) { \
                ; \
        } \
} while (0)
#endif

#if defined(CONFIG_DEBUG_KERNEL_DC)
#define ASSERT(expr) ASSERT_CRITICAL(expr)
#endif

#else
#define ASSERT(expr) WARN_ON(!(expr))
#define BREAK_TO_DEBUGGER() ASSERT(0)
#define ASSERT_CRITICAL(expr) do { if (WARN_ON(!(expr))) { ; } } while (0)
#endif /* CONFIG_DEBUG_KERNEL || CONFIG_DEBUG_DRIVER */

#define DC_ERR(...)  do { \
        dm_error(__VA_ARGS__); \
        BREAK_TO_DEBUGGER(); \
} while (0)

#define dm_alloc(size) kzalloc(size, GFP_KERNEL)
#define dm_realloc(ptr, size) krealloc(ptr, size, GFP_KERNEL)
#define dm_free(ptr) kfree(ptr)

irq_handler_idx dm_register_interrupt(
        struct dc_context *ctx,
        struct dc_interrupt_params *int_params,
        interrupt_handler ih,
        void *handler_args);


/*
 *
 * GPU registers access
 *
 */

#define dm_read_reg(ctx, address)       \
                dm_read_reg_func(ctx, address, __func__)

static inline uint32_t dm_read_reg_func(
        const struct dc_context *ctx,
        uint32_t address,
        const char *func_name)
{
        uint32_t value;

        if (address == 0) {
                DC_ERR("invalid register read. address = 0");
                return 0;
        }

        value = cgs_read_register(ctx->cgs_device, address);

#if defined(__DAL_REGISTER_LOGGER__)
        if (true == dal_reg_logger_should_dump_register()) {
                dal_reg_logger_rw_count_increment();
                DRM_INFO("%s DC_READ_REG: 0x%x 0x%x\n", func_name, address, value);
        }
#endif
        return value;
}

#define dm_write_reg(ctx, address, value)       \
        dm_write_reg_func(ctx, address, value, __func__)

static inline void dm_write_reg_func(
        const struct dc_context *ctx,
        uint32_t address,
        uint32_t value,
        const char *func_name)
{
#if defined(__DAL_REGISTER_LOGGER__)
        if (true == dal_reg_logger_should_dump_register()) {
                dal_reg_logger_rw_count_increment();
                DRM_INFO("%s DC_WRITE_REG: 0x%x 0x%x\n", func_name, address, value);
        }
#endif

        if (address == 0) {
                DC_ERR("invalid register write. address = 0");
                return;
        }
        cgs_write_register(ctx->cgs_device, address, value);
}

static inline uint32_t dm_read_index_reg(
        const struct dc_context *ctx,
        enum cgs_ind_reg addr_space,
        uint32_t index)
{
        return cgs_read_ind_register(ctx->cgs_device, addr_space, index);
}

static inline void dm_write_index_reg(
        const struct dc_context *ctx,
        enum cgs_ind_reg addr_space,
        uint32_t index,
        uint32_t value)
{
        cgs_write_ind_register(ctx->cgs_device, addr_space, index, value);
}

static inline uint32_t get_reg_field_value_ex(
        uint32_t reg_value,
        uint32_t mask,
        uint8_t shift)
{
        return (mask & reg_value) >> shift;
}

#define get_reg_field_value(reg_value, reg_name, reg_field)\
        get_reg_field_value_ex(\
                (reg_value),\
                reg_name ## __ ## reg_field ## _MASK,\
                reg_name ## __ ## reg_field ## __SHIFT)

static inline uint32_t set_reg_field_value_ex(
        uint32_t reg_value,
        uint32_t value,
        uint32_t mask,
        uint8_t shift)
{
        return (reg_value & ~mask) | (mask & (value << shift));
}

#define set_reg_field_value(reg_value, value, reg_name, reg_field)\
        (reg_value) = set_reg_field_value_ex(\
                (reg_value),\
                (value),\
                reg_name ## __ ## reg_field ## _MASK,\
                reg_name ## __ ## reg_field ## __SHIFT)

uint32_t generic_reg_update_ex(const struct dc_context *ctx,
                uint32_t addr, uint32_t reg_val, int n,
                uint8_t shift1, uint32_t mask1, uint32_t field_value1, ...);

#define FD(reg_field)   reg_field ## __SHIFT, \
                                                reg_field ## _MASK

/*
 * return number of poll before condition is met
 * return 0 if condition is not meet after specified time out tries
 */
unsigned int generic_reg_wait(const struct dc_context *ctx,
        uint32_t addr, uint32_t mask, uint32_t shift, uint32_t condition_value,
        unsigned int delay_between_poll_us, unsigned int time_out_num_tries,
        const char *func_name);

/**************************************
 * Power Play (PP) interfaces
 **************************************/

/* DAL calls this function to notify PP about clocks it needs for the Mode Set.
 * This is done *before* it changes DCE clock.
 *
 * If required clock is higher than current, then PP will increase the voltage.
 *
 * If required clock is lower than current, then PP will defer reduction of
 * voltage until the call to dc_service_pp_post_dce_clock_change().
 *
 * \input - Contains clocks needed for Mode Set.
 *
 * \output - Contains clocks adjusted by PP which DAL should use for Mode Set.
 *              Valid only if function returns zero.
 *
 * \returns     true - call is successful
 *              false - call failed
 */
bool dm_pp_pre_dce_clock_change(
        struct dc_context *ctx,
        struct dm_pp_gpu_clock_range *requested_state,
        struct dm_pp_gpu_clock_range *actual_state);

/* The returned clocks range are 'static' system clocks which will be used for
 * mode validation purposes.
 *
 * \returns     true - call is successful
 *              false - call failed
 */
bool dc_service_get_system_clocks_range(
        const struct dc_context *ctx,
        struct dm_pp_gpu_clock_range *sys_clks);

/* Gets valid clocks levels from pplib
 *
 * input: clk_type - display clk / sclk / mem clk
 *
 * output: array of valid clock levels for given type in ascending order,
 * with invalid levels filtered out
 *
 */
bool dm_pp_get_clock_levels_by_type(
        const struct dc_context *ctx,
        enum dm_pp_clock_type clk_type,
        struct dm_pp_clock_levels *clk_level_info);

bool dm_pp_get_clock_levels_by_type_with_latency(
        const struct dc_context *ctx,
        enum dm_pp_clock_type clk_type,
        struct dm_pp_clock_levels_with_latency *clk_level_info);

bool dm_pp_get_clock_levels_by_type_with_voltage(
        const struct dc_context *ctx,
        enum dm_pp_clock_type clk_type,
        struct dm_pp_clock_levels_with_voltage *clk_level_info);

bool dm_pp_notify_wm_clock_changes(
        const struct dc_context *ctx,
        struct dm_pp_wm_sets_with_clock_ranges *wm_with_clock_ranges);

/* DAL calls this function to notify PP about completion of Mode Set.
 * For PP it means that current DCE clocks are those which were returned
 * by dc_service_pp_pre_dce_clock_change(), in the 'output' parameter.
 *
 * If the clocks are higher than before, then PP does nothing.
 *
 * If the clocks are lower than before, then PP reduces the voltage.
 *
 * \returns     true - call is successful
 *              false - call failed
 */
bool dm_pp_apply_display_requirements(
        const struct dc_context *ctx,
        const struct dm_pp_display_configuration *pp_display_cfg);

bool dm_pp_apply_power_level_change_request(
        const struct dc_context *ctx,
        struct dm_pp_power_level_change_request *level_change_req);

bool dm_pp_apply_clock_for_voltage_request(
        const struct dc_context *ctx,
        struct dm_pp_clock_for_voltage_req *clock_for_voltage_req);

bool dm_pp_get_static_clocks(
        const struct dc_context *ctx,
        struct dm_pp_static_clock_info *static_clk_info);

/****** end of PP interfaces ******/

enum platform_method {
        PM_GET_AVAILABLE_METHODS = 1 << 0,
        PM_GET_LID_STATE = 1 << 1,
        PM_GET_EXTENDED_BRIGHNESS_CAPS = 1 << 2
};

struct platform_info_params {
        enum platform_method method;
        void *data;
};

struct platform_info_brightness_caps {
        uint8_t ac_level_percentage;
        uint8_t dc_level_percentage;
};

struct platform_info_ext_brightness_caps {
        struct platform_info_brightness_caps basic_caps;
        struct data_point {
                uint8_t luminance;
                uint8_t signal_level;
        } data_points[99];

        uint8_t data_points_num;
        uint8_t min_input_signal;
        uint8_t max_input_signal;
};

bool dm_get_platform_info(
        struct dc_context *ctx,
        struct platform_info_params *params);

struct persistent_data_flag {
        bool save_per_link;
        bool save_per_edid;
};

/* Call to write data in registry editor for persistent data storage.
 *
 * \inputs      sink - identify edid/link for registry folder creation
 *              module name - identify folders for registry
 *              key name - identify keys within folders for registry
 *              params - value to write in defined folder/key
 *              size - size of the input params
 *              flag - determine whether to save by link or edid
 *
 * \returns     true - call is successful
 *              false - call failed
 *
 * sink         module         key
 * -----------------------------------------------------------------------------
 * NULL         NULL           NULL     - failure
 * NULL         NULL           -        - create key with param value
 *                                                      under base folder
 * NULL         -              NULL     - create module folder under base folder
 * -            NULL           NULL     - failure
 * NULL         -              -        - create key under module folder
 *                                            with no edid/link identification
 * -            NULL           -        - create key with param value
 *                                                       under base folder
 * -            -              NULL     - create module folder under base folder
 * -            -              -        - create key under module folder
 *                                              with edid/link identification
 */
bool dm_write_persistent_data(struct dc_context *ctx,
                const struct dc_sink *sink,
                const char *module_name,
                const char *key_name,
                void *params,
                unsigned int size,
                struct persistent_data_flag *flag);


/* Call to read data in registry editor for persistent data storage.
 *
 * \inputs      sink - identify edid/link for registry folder creation
 *              module name - identify folders for registry
 *              key name - identify keys within folders for registry
 *              size - size of the output params
 *              flag - determine whether it was save by link or edid
 *
 * \returns     params - value read from defined folder/key
 *              true - call is successful
 *              false - call failed
 *
 * sink         module         key
 * -----------------------------------------------------------------------------
 * NULL         NULL           NULL     - failure
 * NULL         NULL           -        - read key under base folder
 * NULL         -              NULL     - failure
 * -            NULL           NULL     - failure
 * NULL         -              -        - read key under module folder
 *                                             with no edid/link identification
 * -            NULL           -        - read key under base folder
 * -            -              NULL     - failure
 * -            -              -        - read key under module folder
 *                                              with edid/link identification
 */
bool dm_read_persistent_data(struct dc_context *ctx,
                const struct dc_sink *sink,
                const char *module_name,
                const char *key_name,
                void *params,
                unsigned int size,
                struct persistent_data_flag *flag);

void dm_delay_in_microseconds
        (struct dc_context *ctx, unsigned int microSeconds);

bool dm_query_extended_brightness_caps
        (struct dc_context *ctx, enum dm_acpi_display_type display,
                        struct dm_acpi_atif_backlight_caps *pCaps);

bool dm_dmcu_set_pipe(struct dc_context *ctx, unsigned int controller_id);

/*
 *
 * print-out services
 *
 */
#define dm_log_to_buffer(buffer, size, fmt, args)\
        vsnprintf(buffer, size, fmt, args)

long dm_get_pid(void);
long dm_get_tgid(void);

#endif /* __DM_SERVICES_H__ */

_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------


Last edited by pelelademadera on Thu Mar 16, 2017 2:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Thu Mar 16, 2017 2:59 pm    Post subject: Reply with quote

pelelademadera wrote:
paraw wrote:
Mmm... can you tell me what is in
/var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/display/dc/dm_services.h
please?


there is a quote in the previous post, I post it...


No, in your previous post you posted /var/lib/dkms/amdgpu-pro/16.60-379184/source/amd/display/dc/dm_services.h
I asked for /var/lib/dkms/amdgpu-pro/16.60-379184/build/amd/display/dc/dm_services.h

Really, I just want to make sure they are the same, because I can see absolutely nothing wrong in the file you posted above, but the compiler is using the file in the build tree, not in the source one, and I'm thinking maybe that's where the problem lies.
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Thu Mar 16, 2017 3:40 pm    Post subject: Reply with quote

I edit the post.

thanks again for your time
_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Thu Mar 16, 2017 4:02 pm    Post subject: Reply with quote

OK, the file is correct. So, now, this can only mean that the part
Code:
#else
#define ASSERT(expr) WARN_ON(!(expr))
#define BREAK_TO_DEBUGGER() ASSERT(0)
#define ASSERT_CRITICAL(expr) do { if (WARN_ON(!(expr))) { ; } } while (0)
#endif /* CONFIG_DEBUG_KERNEL || CONFIG_DEBUG_DRIVER */

is never reached. This would suggest that your kernel is compiled as a debug kernel. However, when the compiler reaches
Code:
#define DC_ERR(...)  do { \
        dm_error(__VA_ARGS__); \
        BREAK_TO_DEBUGGER(); \
} while (0)

it complains that does not know about BREAK_TO_DEBUGGER. At this point, I suspect there must be some mismatch between the kernel you are running, the symlinks and the kernel for which you are trying to compile the module. So, can you please post the output of
Code:
ls -lh /usr/src

and the output of
Code:
uname -a

please?
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Thu Mar 16, 2017 4:14 pm    Post subject: Reply with quote

paraw wrote:
OK, the file is correct. So, now, this can only mean that the part
Code:
#else
#define ASSERT(expr) WARN_ON(!(expr))
#define BREAK_TO_DEBUGGER() ASSERT(0)
#define ASSERT_CRITICAL(expr) do { if (WARN_ON(!(expr))) { ; } } while (0)
#endif /* CONFIG_DEBUG_KERNEL || CONFIG_DEBUG_DRIVER */

is never reached. This would suggest that your kernel is compiled as a debug kernel. However, when the compiler reaches
Code:
#define DC_ERR(...)  do { \
        dm_error(__VA_ARGS__); \
        BREAK_TO_DEBUGGER(); \
} while (0)

it complains that does not know about BREAK_TO_DEBUGGER. At this point, I suspect there must be some mismatch between the kernel you are running, the symlinks and the kernel for which you are trying to compile the module. So, can you please post the output of
Code:
ls -lh /usr/src

and the output of
Code:
uname -a

please?


Code:
pelo@pelo-pc ~/SCRIPTS/optiminer-zcash $ ls -lh /usr/src
total 16K
drwxr-xr-x  6 root root 4,0K mar 16 12:06 amdgpu-pro-16.60-379184
lrwxrwxrwx  1 root root   21 mar 16 09:02 linux -> linux-4.9.6-gentoo-r1
drwxr-xr-x 25 root root 4,0K mar 16 09:15 linux-4.8.17
drwxr-xr-x 26 root root 4,0K mar 16 11:11 linux-4.9.6-gentoo-r1
drwxr-xr-x  7 root root 4,0K mar 15 02:00 rpm
pelo@pelo-pc ~/SCRIPTS/optiminer-zcash $ uname -a
Linux pelo-pc 4.9.6-gentoo-r1-pelo #9 SMP PREEMPT Thu Mar 16 10:24:05 ART 2017 x86_64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz GenuineIntel GNU/Linux



its a debugger kernel cause I set debugging options to try to build dkms in some previous relases.
I'll try disabling that.
I dont use it
_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Thu Mar 16, 2017 4:18 pm    Post subject: Reply with quote

pelelademadera wrote:

Code:
pelo@pelo-pc ~/SCRIPTS/optiminer-zcash $ ls -lh /usr/src
total 16K
drwxr-xr-x  6 root root 4,0K mar 16 12:06 amdgpu-pro-16.60-379184
lrwxrwxrwx  1 root root   21 mar 16 09:02 linux -> linux-4.9.6-gentoo-r1
drwxr-xr-x 25 root root 4,0K mar 16 09:15 linux-4.8.17
drwxr-xr-x 26 root root 4,0K mar 16 11:11 linux-4.9.6-gentoo-r1
drwxr-xr-x  7 root root 4,0K mar 15 02:00 rpm
pelo@pelo-pc ~/SCRIPTS/optiminer-zcash $ uname -a
Linux pelo-pc 4.9.6-gentoo-r1-pelo #9 SMP PREEMPT Thu Mar 16 10:24:05 ART 2017 x86_64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz GenuineIntel GNU/Linux



its a debugger kernel cause I set debugging options to try to build dkms in some previous relases.
I'll try disabling that.
I dont use it

Yes, please. Disable that if you don't use it and try again.
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Thu Mar 16, 2017 4:55 pm    Post subject: Reply with quote

paraw wrote:
pelelademadera wrote:

Code:
pelo@pelo-pc ~/SCRIPTS/optiminer-zcash $ ls -lh /usr/src
total 16K
drwxr-xr-x  6 root root 4,0K mar 16 12:06 amdgpu-pro-16.60-379184
lrwxrwxrwx  1 root root   21 mar 16 09:02 linux -> linux-4.9.6-gentoo-r1
drwxr-xr-x 25 root root 4,0K mar 16 09:15 linux-4.8.17
drwxr-xr-x 26 root root 4,0K mar 16 11:11 linux-4.9.6-gentoo-r1
drwxr-xr-x  7 root root 4,0K mar 15 02:00 rpm
pelo@pelo-pc ~/SCRIPTS/optiminer-zcash $ uname -a
Linux pelo-pc 4.9.6-gentoo-r1-pelo #9 SMP PREEMPT Thu Mar 16 10:24:05 ART 2017 x86_64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz GenuineIntel GNU/Linux



its a debugger kernel cause I set debugging options to try to build dkms in some previous relases.
I'll try disabling that.
I dont use it

Yes, please. Disable that if you don't use it and try again.


Worked!!
I can compile dkms, many many many thanks

Now I triyng to repair vulkan. dota still not running
_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
paraw
Apprentice
Apprentice


Joined: 07 Jan 2005
Posts: 158
Location: Coventry (UK)

PostPosted: Thu Mar 16, 2017 4:57 pm    Post subject: Reply with quote

Dota works well on my PC, but in the beginning I had some problems. However, it turns out they were due to Steam, not to the graphics driver. I don't remember what the solution was, but I can check when I get home (I'm at work now). Nonetheless, you can download the vulkan demos and try to run them, if you want to make sure.
Back to top
View user's profile Send private message
pelelademadera
Veteran
Veteran


Joined: 14 Jul 2008
Posts: 1255
Location: La Plata, Argentina

PostPosted: Fri Mar 17, 2017 12:17 am    Post subject: Reply with quote

paraw wrote:
Dota works well on my PC, but in the beginning I had some problems. However, it turns out they were due to Steam, not to the graphics driver. I don't remember what the solution was, but I can check when I get home (I'm at work now). Nonetheless, you can download the vulkan demos and try to run them, if you want to make sure.


well, except vulkan, all works apparently
Code:
pelo@pelo-pc ~ $ /usr/share/vulkan/demos/cube/cube
Failed to load textures


And I still having the same issues in glxinfo...

Code:
pelo@pelo-pc ~ $ glxinfo | grep OpenGL
Xlib:  extension "AMDGPU" missing on display ":0".
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon (TM) RX 480 Graphics
OpenGL core profile version string: 4.5.13468 Core Profile Context 16.60.3
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
Xlib:  extension "AMDGPU" missing on display ":0".
OpenGL version string: 4.5.13468 Compatibility Profile Context 16.60.3
OpenGL shading language version string: 4.50
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
Xlib:  extension "AMDGPU" missing on display ":0".
OpenGL ES profile version string: 4.5.13468 Compatibility Profile Context 16.60.3
OpenGL ES profile shading language version string: 4.50
OpenGL ES profile extensions:
pelo@pelo-pc ~ $



vulkaninfo returns me a single error and a few warnings:

Code:
pelo@pelo-pc ~ $ vulkaninfo | grep ERROR && vulkaninfo | grep WARNING
ERROR: [loader] Code 0 : /usr/lib32/vulkan/vendors/amdgpu-pro/amdvlk32.so: wrong ELF class: ELFCLASS32
WARNING: [loader] Code 0 : loader_icd_scan: ICD JSON /etc/vulkan/icd.d/amd_icd32.json does not have an 'api_version' field.
WARNING: [loader] Code 0 : loader_icd_scan: ICD JSON /etc/vulkan/icd.d/amd_icd64.json does not have an 'api_version' field.



pelo@pelo-pc ~ $ ldd /usr/lib32/vulkan/vendors/amdgpu-pro/amdvlk32.so
        linux-gate.so.1 (0xf77b5000)
        libdrm_amdgpu.so.1 => /usr/lib32/opengl/amdgpu-pro/lib/libdrm_amdgpu.so.1 (0xf6b5b000)
        libc.so.6 => /lib32/libc.so.6 (0xf69b0000)
        libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/32/libstdc++.so.6 (0xf6870000)
        libdl.so.2 => /lib32/libdl.so.2 (0xf686b000)
        libpthread.so.0 => /lib32/libpthread.so.0 (0xf684e000)
        libdrm.so.2 => /usr/lib32/libdrm.so.2 (0xf683a000)
        /lib/ld-linux.so.2 (0x5663a000)
        libm.so.6 => /lib32/libm.so.6 (0xf67e6000)
        libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/32/libgcc_s.so.1 (0xf67ca000)


pelo@pelo-pc ~ $ equery b /lib32/libc.so.6 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/32/libstdc++.so.6 /lib32/libdl.so.2 /lib32/libpthread.so.0 /usr/lib32/libdrm.so.2 /lib32/libm.so.6 linux-gate.so.1
 * Searching for /lib32/libc.so.6,/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/32/libstdc++.so.6,/lib32/libdl.so.2,/lib32/libpthread.so.0,/usr/lib32/libdrm.so.2,/lib32/libm.so.6,linux-gate.so.1 ...
sys-devel/gcc-4.9.4 (/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.4/32/libstdc++.so.6 -> libstdc++.so.6.0.20)
sys-libs/glibc-2.23-r3 (/lib32/libm-2.23.so)
sys-libs/glibc-2.23-r3 (/lib32/libdl-2.23.so)
sys-libs/glibc-2.23-r3 (/lib32/libdl.so.2 -> libdl-2.23.so)
sys-libs/glibc-2.23-r3 (/lib32/libm.so.6 -> libm-2.23.so)
sys-libs/glibc-2.23-r3 (/lib32/libc-2.23.so)
sys-libs/glibc-2.23-r3 (/lib32/libpthread-2.23.so)
sys-libs/glibc-2.23-r3 (/lib32/libc.so.6 -> libc-2.23.so)
sys-libs/glibc-2.23-r3 (/lib32/libpthread.so.0 -> libpthread-2.23.so)
x11-libs/libdrm-2.4.75 (/usr/lib32/libdrm.so.2 -> libdrm.so.2.4.0)
x11-libs/libdrm-2.4.75 (/usr/lib32/libdrm.so.2.4.0)


all is compiled with multilib and abi_x86_32
_________________
el pelado de la gente
------
Los habitantes de las islas Malvinas lo llaman gentoo, nombre en el que se basa la distribución GNU/Linux Gentoo, cuyo objetivo es la optimización para conseguir más rendimiento y velocidad en la ejecución.
------
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum