Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4602965ioa; Wed, 27 Apr 2022 07:18:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQc8CeJlKzVYDwJ4OwFwcDhPJH4bCw1ASwwMBWh2shWz5kfWnvMzGq/qZTJ9PRCzBqwVDG X-Received: by 2002:a05:6870:e74c:b0:e9:4d28:e84f with SMTP id t12-20020a056870e74c00b000e94d28e84fmr5208958oak.212.1651069100613; Wed, 27 Apr 2022 07:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651069100; cv=none; d=google.com; s=arc-20160816; b=F/vu5HvIP0riXSnaz5NDINTpJUB46voxz4WtY9zTUn8P4YpLbk4XzGMmFFtyxXxID9 MJ0NA9rLoJZx/BmhhQG6LyHik384PN04BSgG+SfMOpCpjjgjUvj//533SyWPfBJ5dzuF K4epfwpVplPs1QVatP0MiUeeQ+jBWySeV+mSBmTD10q23TPAW1g0AEwIj7Uy3Rw8+8bz uCJ0ZfrDwcmdqANqwCizvqHGO7lUilNuaOF+cE/g7sGxeyiJ0Cqnmyrta6YQg7Vk3T2D P7uXKA7qjSWvXfK/67dNfrTUTPnhNL9LpUT9U3144SmkA0oUkC4Wji+hrDCit/u054s8 l4Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from:dkim-signature :dkim-filter; bh=s71BKG69g523heKe1yEo9VKmSL/5EGLlD50AE/SchRU=; b=clN9RyA+VulV7dF99NbuScLdldIc5jekE39STwD8VfwFL3LWFM2FOLWcc/JwmPEZob IVGWrK01TfYmNXObl1YdjVgj0Fg90fVfTpIUO285khiEZ0cltv8KRSEVdS2Dn+imVOGf nJVgKH7j6ujYyZJgsY1ddUUxMDi07kXixCqKqL+aiYHR4QPk0CY1vlWDLmjaQSGcW5vY 7f4gOU/d+HtDA6Eup3LqKqsYF2YOAgyfGlrbNKSQ+Ismxnhi7dg9QdPyFnJkLc085E/Y oDKGg2pQUBFUp+3M5ONniHEtWvnhQejqTJmyZ/3nAmpBp4W3zpHMUfC4DNCousNtOOwd exrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=ifbwO0m7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x5-20020a056870b40500b000e95f3985e0si1016436oap.146.2022.04.27.07.18.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 07:18:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=ifbwO0m7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1622A52B3D; Wed, 27 Apr 2022 06:48:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236304AbiD0NvO (ORCPT + 99 others); Wed, 27 Apr 2022 09:51:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236554AbiD0NvJ (ORCPT ); Wed, 27 Apr 2022 09:51:09 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 731C3766A; Wed, 27 Apr 2022 06:47:58 -0700 (PDT) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 1C85520E97B0; Wed, 27 Apr 2022 06:47:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1C85520E97B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1651067278; bh=s71BKG69g523heKe1yEo9VKmSL/5EGLlD50AE/SchRU=; h=From:To:Subject:Date:From; b=ifbwO0m7s/jATQqceeCrnmVeEIvhHzX2cXKpEfhAwiCd74/M8VzUv42AlybCLlOns rXoAQoxBIm3S8+db/8ujimleKpMTVlNzlj3vui3OcfDgu45PD4JteeDG+oO42hHoVq pFFnzL2EG/CJS60yxHsd3dFozwBleudDIoiEp79k= From: Saurabh Sengar To: ssengar@microsoft.com, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, 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: [PATCH] video: hyperv_fb: Allow resolutions with size > 64 MB for Gen1 Date: Wed, 27 Apr 2022 06:47:53 -0700 Message-Id: <1651067273-6635-1-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; - } - - pot_end = pci_resource_end(pdev, 0); - pot_start = pot_end - screen_fb_size + 1; - } - - ret = vmbus_allocate_mmio(&par->mem, hdev, pot_start, pot_end, + ret = vmbus_allocate_mmio(&par->mem, hdev, 0, -1, screen_fb_size, 0x100000, true); if (ret != 0) { pr_err("Unable to allocate framebuffer memory\n"); -- 1.8.3.1