From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Wu Subject: Re: [PATCH 1/4] gpu/vga_switcheroo: add driver control power feature. (v3) Date: Thu, 01 Aug 2013 19:54:14 +0200 Message-ID: <7475682.zspl4SL2PI@al> References: <1375078019-25358-1-git-send-email-airlied@gmail.com> <1375078019-25358-2-git-send-email-airlied@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 8FED4E6682 for ; Thu, 1 Aug 2013 14:01:54 -0700 (PDT) Received: by mail-ee0-f54.google.com with SMTP id e53so1251846eek.27 for ; Thu, 01 Aug 2013 14:01:53 -0700 (PDT) In-Reply-To: <1375078019-25358-2-git-send-email-airlied@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org Cc: tiwai@suse.com List-Id: dri-devel@lists.freedesktop.org Hi Dave, I don't know anything of PM domains, but there was one minor thing I wanted to mention, see below. On Monday 29 July 2013 16:06:56 Dave Airlie wrote: > From: Dave Airlie Something went wrong here I guess? > [..] > > +static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev) > +{ > + struct pci_dev *pdev = to_pci_dev(dev); > + int ret; > + struct vga_switcheroo_client *client, *found = NULL; > + > + /* we need to check if we have to switch back on the video > + device so the audio device can come back */ > + list_for_each_entry(client, &vgasr_priv.clients, list) { > + if ((client->pdev->devfn & ~(0x7)) == (pdev->devfn & ~(0x7)) && > client_is_vga(client)) { Less obfuscated: PCI_SLOT(client->pdev->devfn) == PCI_SLOT(pdev->devfn) > + found = client; > + ret = pm_runtime_get_sync(&client->pdev->dev); > + if (ret) { > + if (ret != 1) > + return ret; > + } > + break; > + } > + } > + ret = dev->bus->pm->runtime_resume(dev); > + if (ret) > + return ret; > + > + /* put the reference for the gpu */ > + if (found) > + pm_runtime_put_autosuspend(&found->pdev->dev); > + return 0; > +} > [..] Regards, Peter