* [PATCH v2 2/2] apple-gmux: Obtain version info from indexed gmux
2012-08-25 8:30 ` [PATCH v2 1/2] apple-gmux: Fix index read functions Bernhard Froemel
@ 2012-08-25 8:30 ` Bernhard Froemel
2012-08-26 0:48 ` Seth Forshee
2012-08-25 17:53 ` [PATCH v2 1/2] apple-gmux: Fix index read functions Henrik Rydberg
2012-08-26 0:47 ` Seth Forshee
2 siblings, 1 reply; 6+ messages in thread
From: Bernhard Froemel @ 2012-08-25 8:30 UTC (permalink / raw)
To: Matthew Garrett, platform-driver-x86, Seth Forshee
Cc: linux-kernel, Bernhard Froemel
From: Bernhard Froemel <froemel@vmars.tuwien.ac.at>
This patch extracts and displays version information from the indexed
gmux device as it is also done for the classic gmux device.
Signed-off-by: Bernhard Froemel <froemel@vmars.tuwien.ac.at>
---
drivers/platform/x86/apple-gmux.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
index c38538e..0e43477 100644
--- a/drivers/platform/x86/apple-gmux.c
+++ b/drivers/platform/x86/apple-gmux.c
@@ -463,18 +463,22 @@ static int __devinit gmux_probe(struct pnp_dev *pnp,
ver_release = gmux_read8(gmux_data, GMUX_PORT_VERSION_RELEASE);
if (ver_major == 0xff && ver_minor == 0xff && ver_release == 0xff) {
if (gmux_is_indexed(gmux_data)) {
+ u32 version;
mutex_init(&gmux_data->index_lock);
gmux_data->indexed = true;
+ version = gmux_read32(gmux_data,
+ GMUX_PORT_VERSION_MAJOR);
+ ver_major = (version >> 24) & 0xff;
+ ver_minor = (version >> 16) & 0xff;
+ ver_release = (version >> 8) & 0xff;
} else {
pr_info("gmux device not present\n");
ret = -ENODEV;
goto err_release;
}
- pr_info("Found indexed gmux\n");
- } else {
- pr_info("Found gmux version %d.%d.%d\n", ver_major, ver_minor,
- ver_release);
}
+ pr_info("Found gmux version %d.%d.%d [%s]\n", ver_major, ver_minor,
+ ver_release, (gmux_data->indexed ? "indexed" : "classic"));
memset(&props, 0, sizeof(props));
props.type = BACKLIGHT_PLATFORM;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] apple-gmux: Fix index read functions
2012-08-25 8:30 ` [PATCH v2 1/2] apple-gmux: Fix index read functions Bernhard Froemel
2012-08-25 8:30 ` [PATCH v2 2/2] apple-gmux: Obtain version info from indexed gmux Bernhard Froemel
@ 2012-08-25 17:53 ` Henrik Rydberg
2012-08-26 0:47 ` Seth Forshee
2 siblings, 0 replies; 6+ messages in thread
From: Henrik Rydberg @ 2012-08-25 17:53 UTC (permalink / raw)
To: Bernhard Froemel
Cc: Matthew Garrett, platform-driver-x86, Seth Forshee, linux-kernel,
Bernhard Froemel
On Sat, Aug 25, 2012 at 10:30:48AM +0200, Bernhard Froemel wrote:
> From: Bernhard Froemel <froemel@vmars.tuwien.ac.at>
>
> Study of Apple's binary driver revealed that the GMUX_READ_PORT should
> be written between calls to gmux_index_wait_ready and
> gmux_index_wait_complete (i.e., the new index protocol must be
> followed). If this is not done correctly, the indexed
> gmux device only partially accepts writes which lead to problems
> concerning GPU switching. Special thanks to Seth Forshee who helped
> greatly with identifying unnecessary changes.
>
> Signed-off-by: Bernhard Froemel <froemel@vmars.tuwien.ac.at>
> ---
Hi Bernhard,
thanks for your patch, this works splendidly; I can resume and select
different screen resolutions using xrandr.
Tested-by: Henrik Rydberg <rydberg@euromail.se>
Henrik
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] apple-gmux: Fix index read functions
2012-08-25 8:30 ` [PATCH v2 1/2] apple-gmux: Fix index read functions Bernhard Froemel
2012-08-25 8:30 ` [PATCH v2 2/2] apple-gmux: Obtain version info from indexed gmux Bernhard Froemel
2012-08-25 17:53 ` [PATCH v2 1/2] apple-gmux: Fix index read functions Henrik Rydberg
@ 2012-08-26 0:47 ` Seth Forshee
2 siblings, 0 replies; 6+ messages in thread
From: Seth Forshee @ 2012-08-26 0:47 UTC (permalink / raw)
To: Bernhard Froemel
Cc: Matthew Garrett, platform-driver-x86, linux-kernel, Bernhard Froemel
On Sat, Aug 25, 2012 at 10:30:48AM +0200, Bernhard Froemel wrote:
> From: Bernhard Froemel <froemel@vmars.tuwien.ac.at>
>
> Study of Apple's binary driver revealed that the GMUX_READ_PORT should
> be written between calls to gmux_index_wait_ready and
> gmux_index_wait_complete (i.e., the new index protocol must be
> followed). If this is not done correctly, the indexed
> gmux device only partially accepts writes which lead to problems
> concerning GPU switching. Special thanks to Seth Forshee who helped
> greatly with identifying unnecessary changes.
>
> Signed-off-by: Bernhard Froemel <froemel@vmars.tuwien.ac.at>
This does better match what Apple's driver does. Thanks Bernhard.
Acked-by: Seth Forshee <seth.forshee@canonical.com>
^ permalink raw reply [flat|nested] 6+ messages in thread