From patchwork Thu Sep 13 11:58:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10599325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1DD12921 for ; Thu, 13 Sep 2018 11:59:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CF4F2AA1C for ; Thu, 13 Sep 2018 11:59:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 011A92AA29; Thu, 13 Sep 2018 11:59:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 947722AA1C for ; Thu, 13 Sep 2018 11:59:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EFA056E67A; Thu, 13 Sep 2018 11:59:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680069.outbound.protection.outlook.com [40.107.68.69]) by gabe.freedesktop.org (Postfix) with ESMTPS id 54DDC6E67A for ; Thu, 13 Sep 2018 11:59:21 +0000 (UTC) Received: from fedoratest.localdomain (155.4.205.56) by SN6PR05MB4589.namprd05.prod.outlook.com (2603:10b6:805:38::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.11; Thu, 13 Sep 2018 11:59:17 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org, linux-graphics-maintainer@vmware.com Subject: [PATCH -fixes 4/5] drm/vmwgfx: Don't impose STDU limits on framebuffer size Date: Thu, 13 Sep 2018 13:58:36 +0200 Message-Id: <20180913115837.7746-4-thellstrom@vmware.com> X-Mailer: git-send-email 2.19.0.rc1 In-Reply-To: <20180913115837.7746-1-thellstrom@vmware.com> References: <20180913115837.7746-1-thellstrom@vmware.com> MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: PR0P264CA0003.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::15) To SN6PR05MB4589.namprd05.prod.outlook.com (2603:10b6:805:38::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7196fed-92a0-49cb-4f13-08d61970559a X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR05MB4589; X-Microsoft-Exchange-Diagnostics: 1; SN6PR05MB4589; 3:tvQgzPw7g7nDTBgaeVj+GGkHiy5ST8rVrZu8v4i+azCrLn9dcpgt646ybCiFBPVw9qRrkmi4qEXThynyF/hNosqYeEL/dA66Ql4Fadx/CMpl+LaYHv46oWzsYBdqj2f+JtWNRW/BNfPZ16kXShjFJcFEnsXjMzXW44D4SQ1KBOjxscGnh9zNYV5pzLl7XmU2SQpYeIsyumqbEAqag2YhVCYLh+uBOsz9xisZDwiotEnSk6xYMuZoRsm/8d7NiJF5; 25:A1otdE1EIQf/0GVmFWtfMkAjrsv00Slbndu8lMVMVlvrDHKoomIHqbgnsOIemyX7kEewKENft6+TwhoRdY4P8D6xF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0I+qHnKw+1F1J5yOWcEKJCqMX6T6Fw97bFYoi/L9wET2BwLooz+qO0G7Rib8fLp0RY9OSXciVXQY7U4CZQUQVj5GRrRMqeOW0i08ONOYWYnOffVgVty6BDh1D6hdP/NXNUUQ6/zovUij52+Ci5G0oih9xjq9D4RlO8dOWW2wST0sTJc=; 4:hXs5gPHkUwlaThVEcj22AqIQNP+Qz/rXECDVYE02LRtacn4x2Ed2QDgeG6siMWqx8KEbnigU1M4ccEqMHDsDadrk6uUJhuumgyrYMwK/HZ+r5lI3EuUgi4NWmxUPlHJWZUpTq2j5U3oTKeVq7B7ctMLdhqF/TbguPSWcEj60UQgZaHaorum8oYQhQMEP8P7V9/J+lu+owZHLDbEqvBvqMexE4SwReYoC0OIGnfjB07/QdcxO5qsqmHfQQ4u8/UR82o10vV8dof1+OvtI62oYBYpmGIppyMzKTYQzMhUInA9lkHpGGlviMUe9oocIuAQO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699050); SRVR:SN6PR05MB4589; BCL:0; PCL:0; RULEID:; SRVR:SN6PR05MB4589; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(39860400002)(136003)(366004)(346002)(199004)(189003)(2906002)(6512007)(81156014)(5660300001)(386003)(106356001)(105586002)(6506007)(53936002)(2870700001)(26005)(6666003)(107886003)(6636002)(97736004)(36756003)(16526019)(51416003)(186003)(486006)(76176011)(11346002)(50466002)(81166006)(52116002)(956004)(8676002)(446003)(476003)(6486002)(48376002)(478600001)(316002)(2616005)(68736007)(66066001)(305945005)(4326008)(1076002)(50226002)(47776003)(8936002)(86362001)(6116002)(7736002)(54906003)(3846002)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR05MB4589; H:fedoratest.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR05MB4589; 23:X/VWnSpO58sgAIVZ5Cf6fqwPtzOMkMhnksV/JlH34?= XTGnFpi7AS970d1RLnlHTPhtlaBc28IxE76kDBNpbKoVWrQHcq1vg/jPKwRvrWM3FgL5gQfL6hKxKDIMK8QFIC/0QH7f1YGywNTrYU8s5xu1L0+E+1w6Dfm6FLGKfOv+5pw/A7cwcFZFWbzmsjbf54NBHkHgWfdX/HshBC0Ev/7k0ANBxJ6IFj5nTABVYSMSJBLxgHSUga1MlD747n2mNjV/lH2wjbuxPrW6nDUoMqdfaGo8EH/6uQLjZr5llT7giNKH3tFEnhzd9d0z+WaPcqh6qyfqELOkMjZr9uZ4Gv69ACqL68jNiCO7DOmz3TnTq6V83uHxINwDT/KpJcr33o1SKg310nnAb4rjYTHUIApgskb5lPyfxRIwnr/NM4f5/+mCY7QUSx8fDnCtpdT+DlG8+fWNCFImnUMWG50J8+7h6KljRGmxO98B0sXS3SfRGoIvdn/W9HcL4YEZemz6jTPyL1onBZHkvE33JbfJpjDAC3O1hw4LkPof9Z8v9hlfI/POMdAqR9YmNvO7etbIT6m7LjXI27i3ioEOroQDyEyiZTOzKlpuZ5jrV/8lZMQWfBK021QUF0RkdAbG34MzOKWaECD7FJ5ZDOalnSxtTSCUc3Dc423JA/x0ob5/v6gqfBdEWRJPmb6c8MO5nWmXhy55cGMcZWhsG/yLwTwtpEXFKCvu857N7RXdehSlykIswPGffDaY/hYJEd3pp7WLxhxzhRaKD37YrMAbLPb6UA1PegX/slf5YwSN58oz5uPwuCWIU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zci13cKJ4myEKH9BInTvB6VDBASQr/oWTT2LCQ7POTVgEubY6aK/xTDUslnynTe1diZ88B6xU2o6Y/USCg3qw6ct3AiUQ2N2bDR4JXUURaYUVHz9/v4ZFitnJ19DG2FynWHSs1SY5KDZWSeRUuH75TnHlAO/Vm1dWY/f1RTkRee5juKkHsjvMy43vVQuSE139LXwvghq9zM4DLPqjWgPzm3+On5Gr/eGF1ruMyugbVwNRQ==; 5:5iGKzWANGhcqV1N7GZAsA1NEIKp2QkrbnAIlUhsnCf1k/B3mpPco5tg+xVRvdHOIMzSDgt+sYDXZnsLt4WLe81maoh6TaTCVYwGdKMuByHsLBF6HG7+iTNyflKjvuZYg2E55JoJtlPcvOE9YEIRGZQf8B8zOnf9dK2wwfOdpkHQ=; 7:IcYrKaJabyQUfIML0J6qzBEDwgPmOoonyiZ5fM8nnFZuPvOiPpNoq8/YKT/ajfM69S4KtuuB7Ki+ix6N5gmydy8Zm+EE4/WwUDZ4F/QO0NxBmvUylw2wGQNKoI9kvqptptIGY90sLkGQz91rboF41wdo8kzd03zjncttOz1tiecg66VftW7UwBV0T3MpqV3oHYUhdbS1hxu/x9Z+1HttCAlFPXGcyn0Bcek27qMNoCTNWKEiFJlSefFzQ448Jq/4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN6PR05MB4589; 20:qTVpIssKIS0lwEl2KweUHQ/k7uSK/k9uE4D3dAkEE6UXDq9RCkNxT7xWj7JJYdpOYVZW4FVAMOw4UMJJTQLjsiwkgRz8WZOsS0xJ5/w68XaJ+ssSoILTHACP4xbv7zCYsksxGNPUsyTsFMM3+ZhMX8r1OwXMvjF9ftH6vDjZMmE= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 11:59:17.2154 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7196fed-92a0-49cb-4f13-08d61970559a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB4589 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pv-drivers@vmware.com, Thomas Hellstrom , Deepak Rawat Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Deepak Rawat If framebuffers are larger, we create bounce surfaces that are within STDU limits. Signed-off-by: Deepak Rawat Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 25 ------------------------- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 24 ++++++++++++++---------- 2 files changed, 14 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index 93f6b96ca7bb..f30e839f7bfd 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -1600,31 +1600,6 @@ int vmw_kms_stdu_init_display(struct vmw_private *dev_priv) dev_priv->active_display_unit = vmw_du_screen_target; - if (dev_priv->capabilities & SVGA_CAP_3D) { - /* - * For 3D VMs, display (scanout) buffer size is the smaller of - * max texture and max STDU - */ - uint32_t max_width, max_height; - - max_width = min(dev_priv->texture_max_width, - dev_priv->stdu_max_width); - max_height = min(dev_priv->texture_max_height, - dev_priv->stdu_max_height); - - dev->mode_config.max_width = max_width; - dev->mode_config.max_height = max_height; - } else { - /* - * Given various display aspect ratios, there's no way to - * estimate these using prim_bb_mem. So just set these to - * something arbitrarily large and we will reject any layout - * that doesn't fit prim_bb_mem later - */ - dev->mode_config.max_width = 8192; - dev->mode_config.max_height = 8192; - } - vmw_kms_create_implicit_placement_property(dev_priv, false); for (i = 0; i < VMWGFX_NUM_DISPLAY_UNITS; ++i) { diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index e125233e074b..80a01cd4c051 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -1404,22 +1404,17 @@ int vmw_surface_gb_priv_define(struct drm_device *dev, *srf_out = NULL; if (for_scanout) { - uint32_t max_width, max_height; - if (!svga3dsurface_is_screen_target_format(format)) { DRM_ERROR("Invalid Screen Target surface format."); return -EINVAL; } - max_width = min(dev_priv->texture_max_width, - dev_priv->stdu_max_width); - max_height = min(dev_priv->texture_max_height, - dev_priv->stdu_max_height); - - if (size.width > max_width || size.height > max_height) { + if (size.width > dev_priv->texture_max_width || + size.height > dev_priv->texture_max_height) { DRM_ERROR("%ux%u\n, exceeds max surface size %ux%u", size.width, size.height, - max_width, max_height); + dev_priv->texture_max_width, + dev_priv->texture_max_height); return -EINVAL; } } else { @@ -1495,8 +1490,17 @@ int vmw_surface_gb_priv_define(struct drm_device *dev, if (srf->flags & SVGA3D_SURFACE_BIND_STREAM_OUTPUT) srf->res.backup_size += sizeof(SVGA3dDXSOState); + /* + * Don't set SVGA3D_SURFACE_SCREENTARGET flag for a scanout surface with + * size greater than STDU max width/height. This is really a workaround + * to support creation of big framebuffer requested by some user-space + * for whole topology. That big framebuffer won't really be used for + * binding with screen target as during prepare_fb a separate surface is + * created so it's safe to ignore SVGA3D_SURFACE_SCREENTARGET flag. + */ if (dev_priv->active_display_unit == vmw_du_screen_target && - for_scanout) + for_scanout && size.width <= dev_priv->stdu_max_width && + size.height <= dev_priv->stdu_max_height) srf->flags |= SVGA3D_SURFACE_SCREENTARGET; /*