dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 117131] vga_switcheroo does not switch IGP -> DIS ( IGP == i915 , DIS == radeon )
Date: Sun, 24 Apr 2016 20:44:00 +0000	[thread overview]
Message-ID: <bug-117131-2300-vz2S1p98be@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-117131-2300@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=117131

--- Comment #4 from Jason Vas Dias <jason.vas.dias@gmail.com> ---
Aha, so this ACPI call failure looks very fatal to any vga_switcheroo :

/**
 * radeon_atpx_switch_start - notify the sbios of a GPU switch
 *
 * @atpx: atpx info struct
 * @mux_id: mux state (0 = integrated GPU, 1 = discrete GPU)
 *
 * Execute the ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION ATPX
 * function to notify the sbios that a switch between the discrete GPU and
 * integrated GPU has begun (all asics).
 * Returns 0 on success, error on failure.
 */
static int radeon_atpx_switch_start(struct radeon_atpx *atpx, u16 mux_id)
{
    struct acpi_buffer params;
    union acpi_object *info;
    struct atpx_mux input;

    if (atpx->functions.switch_start) {
        input.size = 4;
        input.mux = mux_id;
        params.length = input.size;
        params.pointer = &input;
        info = radeon_atpx_call(atpx->handle,
                    ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION,
                    &params);
        if (!info)
            return -EIO;
        kfree(info);
    }
    return 0;
}

/**
 * radeon_atpx_switch_end - notify the sbios of a GPU switch
 *
 * @atpx: atpx info struct
 * @mux_id: mux state (0 = integrated GPU, 1 = discrete GPU)
 *
 * Execute the ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION ATPX
 * function to notify the sbios that a switch between the discrete GPU and
 * integrated GPU has ended (all asics).
 * Returns 0 on success, error on failure.
 */
static int radeon_atpx_switch_end(struct radeon_atpx *atpx, u16 mux_id)
{
    struct acpi_buffer params;
    union acpi_object *info;
    struct atpx_mux input;

    if (atpx->functions.switch_end) {
        input.size = 4;
        input.mux = mux_id;
        params.length = input.size;
        params.pointer = &input;
        info = radeon_atpx_call(atpx->handle,
                    ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION,
                    &params);
        if (!info)
            return -EIO;
        kfree(info);
    }
    return 0;
}





So if any of these ACPI calls fail, the entire switch fails .

There is obviously some way that the closed source FGLRX driver 
is able to make these calls successfully ; the card goes into
graphics mode OK with fglrx under Linux 3.10 (EL7) .

But it appears that the new open source radeon driver 8970M support 
is not working correctly in Linux 4.5.0 .

I guess this bug should more properly be raised directly against the
drivers/gpu/drm/radeon driver then .

Maybe I should try running the EL7 partition OS in a VM and tracing how
FGLRX is calling these ACPI calls & modifying radeon_atpx_handler to make
them the same way ? a rather cumbersome way to get to the bottom of it ...

I will also try various combinations of the above kernel parameters and
radeon.dpm=1 or radeon.dpm=0 .

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-04-24 20:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-24 19:17 [Bug 117131] New: vga_switcheroo does not switch IGP -> DIS ( IGP == i915 , DIS == radeon ) bugzilla-daemon
2016-04-24 19:28 ` [Bug 117131] " bugzilla-daemon
2016-04-24 19:46 ` bugzilla-daemon
2016-04-24 20:30 ` bugzilla-daemon
2016-04-24 20:44 ` bugzilla-daemon [this message]
2016-04-24 23:21 ` bugzilla-daemon
2016-04-25 13:58 ` bugzilla-daemon
2016-04-25 17:43 ` bugzilla-daemon
2016-04-25 17:49 ` bugzilla-daemon
2016-04-25 17:59 ` bugzilla-daemon
2016-04-25 18:49 ` bugzilla-daemon
2016-04-25 19:02 ` bugzilla-daemon
2016-04-25 19:25 ` bugzilla-daemon
2016-04-25 19:39 ` bugzilla-daemon
2016-04-25 20:19 ` bugzilla-daemon
2016-04-25 20:48 ` bugzilla-daemon
2016-04-25 20:51 ` bugzilla-daemon
2016-04-26  0:43 ` bugzilla-daemon
2016-04-26 15:26 ` bugzilla-daemon
2016-04-26 15:52 ` bugzilla-daemon
2016-04-26 16:55 ` bugzilla-daemon
2016-04-26 18:37 ` bugzilla-daemon
2016-04-26 18:38 ` bugzilla-daemon
2016-04-26 18:50 ` bugzilla-daemon
2016-04-26 22:11 ` bugzilla-daemon
2016-04-26 22:16 ` bugzilla-daemon
2016-04-26 22:20 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-117131-2300-vz2S1p98be@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).