[PATCH] nouveau, ACPI: fix regression caused by b072e53 (original) (raw)

Jiang Liu jiang.liu at linux.intel.com
Wed Feb 19 01:47:23 PST 2014


Hi Maarten, Forgot to refresh my working tree. Please help to apply this patch on top of previous one to solve a compilation bug.

diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/no index c6c7d0d..83face3 100644 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c @@ -119,7 +119,7 @@ static int nouveau_check_optimus_dsm(acpi_handle handle) * Function 0 returns a Buffer containing available functions. * The args parameter is ignored for function 0, so just put 0 in it */

On 2014/2/19 12:53, Jiang Liu wrote:

On some platforms, ACPI DSM method (nouveauopdsmmuid, function 0) has special requirements on the fourth parameter, which is different from ACPI specifications. So revert to the private implementation to check availability of DSM functions instead of using common acpicheckdsm() interface.

Signed-off-by: Jiang Liu <jiang.liu at linux.intel.com> --- Hi Maarten, Thanks for bisecting. Could you please help to verify whether this patch fixes the regression? Thanks! Gerry --- drivers/gpu/drm/nouveau/nouveauacpi.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveauacpi.c b/drivers/gpu/drm/nouveau/nouveauacpi.c index 4ef83df..c6c7d0d 100644 --- a/drivers/gpu/drm/nouveau/nouveauacpi.c +++ b/drivers/gpu/drm/nouveau/nouveauacpi.c @@ -106,6 +106,29 @@ static int nouveauoptimusdsm(acpihandle handle, int func, int arg, uint32t * return 0; } +/* + * On some platforms, DSM(nouveauopdsmmuid, func0) has special + * requirements on the fourth parameter, so a private implementation + * instead of using acpicheckdsm(). + */ +static int nouveaucheckoptimusdsm(acpihandle handle) +{ + int result; + + /* + * Function 0 returns a Buffer containing available functions. + * The args parameter is ignored for function 0, so just put 0 in it + */ + if (nouveauoptimusdsm(handle, 0, 0, &result) + return 0; + + /* + * ACPI Spec v4 9.14.1: if bit 0 is zero, no function is supported. + * If the n-th bit is enabled, function n is supported + */ + return result & 1 && result & (1 << NOUVEAUDSMOPTIMUSCAPS); +} + static int nouveaudsm(acpihandle handle, int func, int arg) { int ret = 0; @@ -207,8 +230,7 @@ static int nouveaudsmpciprobe(struct pcidev *pdev) 1 << NOUVEAUDSMPOWER)) retval |= NOUVEAUDSMHASMUX; - if (acpicheckdsm(dhandle, nouveauopdsmmuid, 0x00000100, - 1 << NOUVEAUDSMOPTIMUSCAPS)) + if (nouveaucheckoptimusdsm(dhandle)) retval |= NOUVEAUDSMHASOPT; if (retval & NOUVEAUDSMHASOPT) {



More information about the dri-devel mailing list