All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Thomas Zimmermann <tzimmermann@suse.de>,
	airlied@redhat.com, dri-devel@lists.freedesktop.org
Cc: evanevery@digitalintelligence.com
Subject: Re: [PATCH] drm/ast: Remove existing framebuffers before loading driver
Date: Thu, 15 Nov 2018 13:49:45 +0100	[thread overview]
Message-ID: <1542286185.2661.49.camel@suse.de> (raw)
In-Reply-To: <20181115104216.15790-1-tzimmermann@suse.de>

On Thu, 2018-11-15 at 11:42 +0100, Thomas Zimmermann wrote:
> If vesafb attaches to the AST device, it configures the framebuffer memory
> for uncached access by default. When ast.ko later tries to attach itself to
> the device, it wants to use write-combining on the framebuffer memory, but
> vesefb's existing configuration for uncached access takes precedence. This
> results in reduced performance.
> 
> Removing the framebuffer's configuration before loding the AST driver fixes
> the problem. Other DRM drivers already contain equivalent code.
> 
> Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1112963
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Tested-by: Y.C. Chen <yc_chen@aspeedtech.com>
> ---
>  drivers/gpu/drm/ast/ast_drv.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
> index 69dab82a3771..bf589c53b908 100644
> --- a/drivers/gpu/drm/ast/ast_drv.c
> +++ b/drivers/gpu/drm/ast/ast_drv.c
> @@ -60,8 +60,29 @@ static const struct pci_device_id pciidlist[] = {
>  
>  MODULE_DEVICE_TABLE(pci, pciidlist);
>  
> +static void ast_kick_out_firmware_fb(struct pci_dev *pdev)
> +{
> +	struct apertures_struct *ap;
> +	bool primary = false;
> +
> +	ap = alloc_apertures(1);
> +	if (!ap)
> +		return;
> +
> +	ap->ranges[0].base = pci_resource_start(pdev, 0);
> +	ap->ranges[0].size = pci_resource_len(pdev, 0);
> +
> +#ifdef CONFIG_X86
> +	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
> +#endif
> +	drm_fb_helper_remove_conflicting_framebuffers(ap, "astdrmfb", primary);
> +	kfree(ap);
> +}
> +
>  static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  {
> +	ast_kick_out_firmware_fb(pdev);
> +
>  	return drm_get_pci_dev(pdev, ent, &driver);
>  }
>  

Thank you very much Thomas.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>

-- 
Jean Delvare
SUSE L3 Support
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2018-11-15 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-15 10:42 [PATCH] drm/ast: Remove existing framebuffers before loading driver Thomas Zimmermann
2018-11-15 12:49 ` Jean Delvare [this message]

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=1542286185.2661.49.camel@suse.de \
    --to=jdelvare@suse.de \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=evanevery@digitalintelligence.com \
    --cc=tzimmermann@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.