lkml.org 
[lkml]   [2022]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] video: hyperv_fb: Allow resolutions with size > 64 MB for Gen1
Date


> -----Original Message-----
> From: Wei Liu <wei.liu@kernel.org>
> Sent: Thursday, April 28, 2022 10:38 AM
> To: Saurabh Sengar <ssengar@linux.microsoft.com>
> Cc: Saurabh Singh Sengar <ssengar@microsoft.com>; KY Srinivasan
> <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Stephen
> Hemminger <sthemmin@microsoft.com>; wei.liu@kernel.org; Dexuan Cui
> <decui@microsoft.com>; deller@gmx.de; linux-hyperv@vger.kernel.org; linux-
> fbdev@vger.kernel.org; dri-devel@lists.freedesktop.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH] video: hyperv_fb: Allow resolutions with size > 64 MB for
> Gen1
>
> On Wed, Apr 27, 2022 at 06:47:53AM -0700, Saurabh Sengar wrote:
> > This patch fixes a bug where GEN1 VMs doesn't allow resolutions greater
> > than 64 MB size (eg 7680x4320). Unnecessary PCI check limits Gen1 VRAM
> > to legacy PCI BAR size only (ie 64MB). Thus any, resolution requesting
> > greater then 64MB (eg 7680x4320) would fail. MMIO region assigning this
> > memory shouldn't be limited by PCI bar size.
> >
> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > ---
> > drivers/video/fbdev/hyperv_fb.c | 19 +------------------
> > 1 file changed, 1 insertion(+), 18 deletions(-)
> >
> > diff --git a/drivers/video/fbdev/hyperv_fb.c
> b/drivers/video/fbdev/hyperv_fb.c
> > index c8e0ea2..58c304a 100644
> > --- a/drivers/video/fbdev/hyperv_fb.c
> > +++ b/drivers/video/fbdev/hyperv_fb.c
> > @@ -1009,7 +1009,6 @@ static int hvfb_getmem(struct hv_device *hdev,
> struct fb_info *info)
> > struct pci_dev *pdev = NULL;
> > void __iomem *fb_virt;
> > int gen2vm = efi_enabled(EFI_BOOT);
> > - resource_size_t pot_start, pot_end;
> > phys_addr_t paddr;
> > int ret;
> >
> > @@ -1060,23 +1059,7 @@ static int hvfb_getmem(struct hv_device *hdev,
> struct fb_info *info)
> > dio_fb_size =
> > screen_width * screen_height * screen_depth / 8;
> >
> > - if (gen2vm) {
> > - pot_start = 0;
> > - pot_end = -1;
> > - } else {
> > - if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
> > - pci_resource_len(pdev, 0) < screen_fb_size) {
> > - pr_err("Resource not available or (0x%lx < 0x%lx)\n",
> > - (unsigned long) pci_resource_len(pdev, 0),
> > - (unsigned long) screen_fb_size);
> > - goto err1;
>
> This restriction has been in place since day 1. Haiyang, you wrote this
> driver. Can you comment on whether this change here is sensible?

When I initially implemented this driver 10 years ago, I believe there
was smaller limit for the fb... But I think this patch is good for the
newer MMIO alloc scheme. I hope to see reviews also from
@Dexuan Cui @Michael Kelley (LINUX) who are more familiar with
the PCI/BAR/MMIO area.

Thanks,
- Haiyang

\
 
 \ /
  Last update: 2022-05-04 18:45    [W:0.111 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site