LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Current (14.2) and DRI 3 and DRI_PRIME ain't working. (https://www.linuxquestions.org/questions/slackware-14/current-14-2-and-dri-3-and-dri_prime-aint-working-4175578108/)

Nille_kungen 04-22-2016 10:19 AM

Current (14.2) and DRI 3 and DRI_PRIME ain't working.
 
In current DRI 3 doesn't work and i can't use my second graphics card.
Code:

cat /var/log/Xorg.0.log | grep DRI
[    70.655] (**) RADEON(0): Option "DRI" "3"
[    71.278] (**) RADEON(G0): Option "DRI" "3"
[    71.345] (==) RADEON(G0): DRI3 disabled
[    71.346] (II) RADEON(0): [DRI2] Setup complete
[    71.346] (II) RADEON(0): [DRI2]  DRI driver: r600
[    71.346] (II) RADEON(0): [DRI2]  VDPAU driver: r600
[    71.346] (**) RADEON(0): DRI3 enabled
[    74.175] (II) GLX: Initialized DRI2 GL provider for screen 0

Code:

xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x76 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 3 associated providers: 0 name:ARUBA @ pci:0000:00:01.0
Provider 1: id: 0x3f cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:HAINAN @ pci:0000:01:00.0

Code:

xrandr --setprovideroffloadsink 0x3f 0x76
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  139 (RANDR)
  Minor opcode of failed request:  34 (RRSetProviderOffloadSink)
  Value in failed request:  0x3f
  Serial number of failed request:  16
  Current serial number in output stream:  17

Earlier i used xrandr --setprovideroffloadsink 0x4f 0x86 but the id has changed.
Code:

xrandr --setprovideroffloadsink 0x4f 0x86
Could not find provider with XID 0x4f

Code:

DRI_PRIME=1 glxinfo | grep "OpenGL renderer"         
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeonsi: Failed to create a context.
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeonsi: Failed to create a context.
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeonsi: Failed to create a context.
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeonsi: Failed to create a context.
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeonsi: Failed to create a context.
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeonsi: Failed to create a context.
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    alignment : 4096 bytes
radeon:    domains  : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to deallocate virtual address for buffer:
radeon:    size      : 65536 bytes
radeon:    va        : 0x0000000000800000
radeonsi: Failed to create a context.
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  44
  Current serial number in output stream:  43

Does anyone else have a similar problem?

Nille_kungen 04-22-2016 12:18 PM

I started recompiling the things related to the error but it didn't solve it.
Started to compile different version and found out that the problem is the current kernel.
I tried an older kernel i had installed and it started to work again and that kernel also shows the right ID with "xrandr --listproviders"

Nille_kungen 04-22-2016 01:59 PM

Kernel 4.4.6 work but not 4.4.7 or 4.4.8
I will see if i get time to bisect which commit that caused this so i can report a bug upstreams.

ReaperX7 04-22-2016 02:25 PM

Try adding:

Code:

export DRI_PRIME=1
to your system or user environment variables. Use root to create a file in /etc/profile.d as xorg_prime.sh and entire the command posted above, and then reboot. This should enable your secondary card correctly when you load Xorg.

You should also edit your /etc/X11/xorg.conf or /etc/X11/xorg.conf.d specific vendor file in use the following for your Radeon to use:

Code:

Option "AccelMethod" "glamor"
Option "DRI" "3"

You may need to enable glamor acceleration.

Nille_kungen 04-22-2016 02:35 PM

Glamor is worse for me and i do already have an /etc/X11/xorg.conf.d/20-radeon.conf i don't have problems with how to set DRI 3 it's that last kernel update broke it.
I need to bisect the kernel to see what broke it, 4.4.6 good and 4.4.7 bad.

ReaperX7 04-22-2016 02:41 PM

Have you tried kernel 4.4.8 yet?

Nille_kungen 04-22-2016 02:45 PM

Yes 4.4.8 is bad

ReaperX7 04-22-2016 02:48 PM

What about 4.5.2 or 4.6rc4?

Nille_kungen 04-22-2016 03:11 PM

Those won't be in slackware 14.2 so i haven't checked them i only looking into 4.4
I started bisect now if it goes fast i might finish it tonight and find the bad commit.

Nille_kungen 04-22-2016 03:18 PM

Since it calculates the ID:s wrong it i think it's only an typo and i might even supply a patch upstream but i need to wait for the bisect to finish first to know whats happening.
Normally i wouldn't post about this here but since we're so close to an release i posted so we don't get stable with an broken kernel for some users.

ReaperX7 04-23-2016 07:12 PM

What version of xorg-server is -Current using? 1.18.2 or 1.18.3?

willysr 04-23-2016 09:28 PM

1.18.3

voyagerok 04-24-2016 07:09 AM

Have the same issue on arch linux and fedora. On fedora it started after upgrading kernel from 4.4.6 to 4.4.7, on arch after 4.4.5 - 4.5.1.

Nille_kungen 04-24-2016 09:51 AM

Quote:

Originally Posted by voyagerok (Post 5535769)
Have the same issue on arch linux and fedora. On fedora it started after upgrading kernel from 4.4.6 to 4.4.7, on arch after 4.4.5 - 4.5.1.

It were broken in 4.6RC but it got fixed in 4.6RC5 "Revert drm/radeon: disable runtime pm on PX laptops without
dGPU power control".
But i got good news i did trace it and found the bad commit.
https://github.com/torvalds/linux/co...b2504ce2d5b352
An quick fix is to revert the bad commit.
Patch made with "git show -R 791b5b0d2d01542a87af4b5f8fb2504ce2d5b352 > /tmp/dGPU.patch"
Code:

commit 791b5b0d2d01542a87af4b5f8fb2504ce2d5b352
Author: Alex Deucher <alexander.deucher@amd.com>
Date:  Wed Mar 2 11:47:29 2016 -0500

    drm/radeon: disable runtime pm on PX laptops without dGPU power control
   
    commit e64c952efb8e0c15ae82cec8e455ab4910690ef1 upstream.
   
    Some PX laptops don't provide an ACPI method to control dGPU power.  On
    those systems, the driver is responsible for handling the dGPU power
    state.  Disable runtime PM on them until support for this is implemented.
   
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

diff --git b/drivers/gpu/drm/radeon/radeon_atpx_handler.c a/drivers/gpu/drm/radeon/radeon_atpx_handler.c
index 9bc408c..c4b4f29 100644
--- b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
+++ a/drivers/gpu/drm/radeon/radeon_atpx_handler.c
@@ -62,10 +62,6 @@ bool radeon_has_atpx(void) {
        return radeon_atpx_priv.atpx_detected;
 }
 
-bool radeon_has_atpx_dgpu_power_cntl(void) {
-      return radeon_atpx_priv.atpx.functions.power_cntl;
-}
-
 /**
  * radeon_atpx_call - call an ATPX method
  *
@@ -145,6 +141,10 @@ static void radeon_atpx_parse_functions(struct radeon_atpx_functions *f, u32 mas
  */
 static int radeon_atpx_validate(struct radeon_atpx *atpx)
 {
+      /* make sure required functions are enabled */
+      /* dGPU power control is required */
+      atpx->functions.power_cntl = true;
+
        if (atpx->functions.px_params) {
                union acpi_object *info;
                struct atpx_px_params output;
diff --git b/drivers/gpu/drm/radeon/radeon_device.c a/drivers/gpu/drm/radeon/radeon_device.c
index f78f111..c566993 100644
--- b/drivers/gpu/drm/radeon/radeon_device.c
+++ a/drivers/gpu/drm/radeon/radeon_device.c
@@ -103,12 +103,6 @@ static const char radeon_family_name[][16] = {
        "LAST",
 };
 
-#if defined(CONFIG_VGA_SWITCHEROO)
-bool radeon_has_atpx_dgpu_power_cntl(void);
-#else
-static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; }
-#endif
-
 #define RADEON_PX_QUIRK_DISABLE_PX  (1 << 0)
 #define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1)
 
@@ -1439,7 +1433,7 @@ int radeon_device_init(struct radeon_device *rdev,
        * ignore it */
        vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode);
 
-      if ((rdev->flags & RADEON_IS_PX) && radeon_has_atpx_dgpu_power_cntl())
+      if (rdev->flags & RADEON_IS_PX)
                runtime = true;
        vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops, runtime);
        if (runtime)

Could you confirm the bug in the bug report?
https://bugs.freedesktop.org/show_bug.cgi?id=95078

ReaperX7 04-24-2016 09:58 AM

I wonder if this may effect single cards as well?

Glad you found the fix for it. What is your Xorg.0.log producing now with the patch in place?


All times are GMT -5. The time now is 07:33 PM.