From patchwork Tue Jan 9 14:49:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10152735 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 86D1F60223 for ; Tue, 9 Jan 2018 16:23:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CC5F25EA6 for ; Tue, 9 Jan 2018 16:23:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 915BA28534; Tue, 9 Jan 2018 16:23:51 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 0FCD825EA6 for ; Tue, 9 Jan 2018 16:23:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E51DD89FC8; Tue, 9 Jan 2018 16:23:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0070.outbound.protection.outlook.com [104.47.33.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id B6A2589FC8 for ; Tue, 9 Jan 2018 16:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TMEJ1dfJvw/vTF50p5uCEmsNIyvI01KInXLN+1g3/EM=; b=pzrX3SWOqGdDJl5tMfWL2MK2ATVJz/8gDfIRTf0Jvf/ULcTXJLfVu3DCKU6g20BJGIuyIRIrYq9ZSaooNVEqGCgkLRZvqOUB9zAWPI77S5OSJgYqs/FDPg5td0rXFKrRsxJ5cDHyjeaJhrLNVqhulXKU0ZU5a3dksqiJAa9zO1E= Received: from localhost.localdomain.localdomain (155.4.205.56) by BY2PR05MB759.namprd05.prod.outlook.com (10.141.224.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.1; Tue, 9 Jan 2018 14:50:17 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/vmwgfx: Don't cache framebuffer maps Date: Tue, 9 Jan 2018 15:49:49 +0100 Message-Id: <20180109144949.2673-1-thellstrom@vmware.com> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: HE1PR0401CA0058.eurprd04.prod.outlook.com (10.168.27.26) To BY2PR05MB759.namprd05.prod.outlook.com (10.141.224.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bc8baf80-d021-443a-af19-08d557704d1d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020040)(4652020)(4534070)(4602075)(4627166)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:BY2PR05MB759; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB759; 3:fpSqrScNvf4FG6PN8QSpYeHOaGqu7sdnvDAjkvYNf9FBwjzMr1hi2yvAvbF/MNSSCgxThf0+v4m0R/xyZBTq3qpvdGYrHUzNyCwGJLj0OhTcNKk2Op6dP1L4O+aKJqRFcQo7cUmWZeJjuYMLrsbJeakmgEK6iVsv6uoEjY0bnNm79yB+ppr6x+6vxdyCRYNKLkVEALhPLwBN4Yxe9B+6cjqoU3DU/zc7ix3DFEdnmjIFs3JRgLHD3oH9qKK1on1P; 25:4PmkW1+8usliQOy8WQ/bLwe1/pWvJnA3oysnOHnabYz2R6mXMPn0jlVhDWJeCLaJA2tD5qikMNaVImr2nSYZaAlQMsjtRIv6vO5crdxsbixbyn4ojKn5PPCpTjiLZAMbTmy//zwqafHkwIr69FrzNX4fZftvJe7O/V9eN6BMFr/bg+CyemeCqqdNsT+ba349CXAKjdViqlh6zPxiXFRpZT4diUkcCuw0N5UoO16HfryZEa3K6TLE0AWeb0yLrjqtp2jNdC92j0HUagyr5u8GjkAYMBShBU/HCAj1Qt3UvzFW9kpp452pmc8BOfyGgG+P0R9qZlCBAONQFFdEqu251w==; 31:OAjwqln6dZ1vaMFp+T9dikFhB11dxJulkmeiSbPJg/J6lU9V6ZlDd7mjFYneeV0JEm6cjx3TWSXi3A3XTmgHf0vh8sQ5og2suJRjpvq9h+cuLRQcA93YRezC1DZ5Tv1unRsybuXwXYVBmbfERPl5ut5s0mrNsLBhY9U2c/fl7Yet7520iZeIqOdS3wRvWZzO1upnPzVK2zYY20LjlKck6Wf7jSsygkNWpfeobrvfg70= X-MS-TrafficTypeDiagnostic: BY2PR05MB759: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=thellstrom@vmware.com; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB759; 20:EUqoZfLXGW0hkqewGUoUhK8VAuoer7mlw61PHqxqwjs1+qHRMC/HchlPhgsbjvVN7LxStvrBSAjvRAf6D+Ag+E0qLcyQtoi5iIuOZitCo9VMmVEAtrr22/SGwrs+5yRZsE6LbWw+4X1WDec+aL9UiMQ1LowSKph8nAvrTi+9zmVKRFyRxODHCdmBBYLuwN5ivc7PLKumA2kF57BDtWlXgySe90M5olMmI1wiBtmvpj9R3xmsmi3yn1ctX1eASC6OAK7DoWd7yWT/l0IfbF5+HkDr8nl9hMdE3X3qwv1PiWG0UfJButU5w/abHA+NX9nIEbplxlHIwyQeTbiM3FphwDpp+BD8HGZjxTvj3RgKvYjBWeSh2RkjMt25UDclwYEd87iaTHH3cFVODOVIZjSqL0mLMTdbbZJf/tZh7pv/PPFA6a5j9/iUsUFS7o4UUB9UGPUYf6snyR65RjTQWXbuyxCc7MHm+Sd7h723fQt6a6iSR8tEylWmE+OEg6+wD1SX; 4:QhDJW1qTjlZep2X4pseg0LahkcYG6bLOmSH32y/R3NZVssK4kHdaufbj3iN3hvrOZqtxvay+uisQ6MtCxJbAdZAmsns/Wn6iOHreP3qtaEeEJaDf6qu0hXtcCTMopQVnSf6Nd3urkbNUMo8P1qIdfd28kYELenDHMOpQyY3CfhVyZG4cIqTrlvczweP/OM8pmg2KfNI4QJCg9HYw7hJO+wzA1gNnj0sOzVRUmRs0vlfXmLRj3mZcn10x6b8S3kpxKkcQehm1+NoU2J5/yxU8SJg4dX7cytc8RfxxWQw2/+v0MSHEIZ+r9H0MpwWHCfXAI49rvqJmmL/K0Bi//w6u6NqJIHVGceBAtFmm0c9JbTo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150)(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231023)(944501110)(6041268)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:BY2PR05MB759; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BY2PR05MB759; X-Forefront-PRVS: 0547116B72 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(39860400002)(396003)(376002)(366004)(39380400002)(199004)(189003)(68736007)(8936002)(8676002)(86362001)(6512007)(53936002)(81156014)(3846002)(50466002)(4326008)(1076002)(6116002)(16526018)(81166006)(97736004)(2906002)(6666003)(48376002)(6916009)(50226002)(36756003)(47776003)(386003)(66066001)(316002)(16586007)(2351001)(6506007)(106356001)(2361001)(25786009)(59450400001)(52116002)(105586002)(5660300001)(6486002)(478600001)(7736002)(305945005)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR05MB759; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB759; 23:+uyceVeUKNpKeOhyQ/GcwwsYGiAjgMOLXSpF3hHKqQ?= =?us-ascii?Q?rB/e2lOg02DNmKClUgL+fnp09uYeA/OkVrz0KKgWiCn9JqP0+BD8atnSZIgX?= =?us-ascii?Q?YlUbMCpmvZff7BySUT+J1BV11Bayo72u/Glub1Xqq2NFq1Ii3SqPNABAS52w?= =?us-ascii?Q?ki+jdssu/pXqZ6MlSe2zJUYaahl3wojWgcDI98nnqqsUj1wVFxkJlxo0aNkD?= =?us-ascii?Q?pEbjy4y20S+voBp/FtCFo1xoRuVy3y4XQlK8fu6whCraQmHukRzggY19UXxN?= =?us-ascii?Q?OHZv+RJQlhtDjwv2nEd87z0mM+3nlwoSSElnh4VM4AmPTJKeN7ot8l4ryfu+?= =?us-ascii?Q?zGJLMYm6BvtDzf06qCr+WGX/I4rI/g0W+bakVi2oURuTFAINP4VPgzU1NsrO?= =?us-ascii?Q?B1yXF9u8KmWX5vBmHGECd9eGDtQ8gIkx72AUfM2vJnH2gDrsiKz7r8KZncS1?= =?us-ascii?Q?snHwFLtaLpagO8SooIM2946alv5NY/lT3E3TcKhalkh56dUBZJIM6wxEJlea?= =?us-ascii?Q?LQbIa3XkcApCyt0FGgso0HgJh9QyxE0qXhE3Iw9IDihHyNScpoIVSRQCADW8?= =?us-ascii?Q?nTpoNy2CzAuHQlCj2tJwRGb9qaJ/a307ibJAMuDMeTuLVIREeu8nxLR2oTqv?= =?us-ascii?Q?QWqIt0/2BEEj/vZHorg8DSAakEeqk55wETUQFU+rhpFVejxAD/GvP4Dl5aup?= =?us-ascii?Q?jfB6Ebm490FdMJtkdVX23lPaPGruT4ZTaHxHEoIoiUwszZcNc5QgupPLLv23?= =?us-ascii?Q?i/jEr2vyJb2gMT3EnYBa1gsb5Vlxi+j8zFur/NipB6E1qTAGTVK1B59oqJ/r?= =?us-ascii?Q?FhIf2PZvoWVBV+umWv0p1Y6LnWHrlKPMMOq7NY0UkXauGfZhoXyZjyThS4Bw?= =?us-ascii?Q?OGR1YF5+E+nJEqi9m85nB7NCuZfQNrMxIbDIwxXsXb0SxROOybn9ExbbrPW1?= =?us-ascii?Q?onkjL5gzohgrTwaQhP6l6zZuxGhbwfWytqN5HxuR9wX3MVu5XbpyuAghnoyH?= =?us-ascii?Q?nj3rMLyaIPtPamby6ZXBHJyIPoQUJaX5WFn2Kf10Kw8Wlw5rzC2rlhcHbhNP?= =?us-ascii?Q?3l9HwQ5BEGBz2JGZkRh2yJcTOv0G3vzoiohPPERc6LD0f2PEeo0Dhz6qlR/u?= =?us-ascii?Q?OeQcvuf1E=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB759; 6:kFMxJOtQ360r5e4Hm7E1+OgB6xTnAxe1BA69khi1Xcc03XA0rBeGSo8ogSQK3CaRVEqXeyU5f5q6+pKzLuUmgYth1/HICDqwQ8HlHVmIOspnLJDHai9vNpJ/fm+xIHinhaJ1nHydDSl+TS3zXLt6VCxSpx6NN4bBqnYmYUvg23v3f38E2AaG/e+CRa7ZuanLLj5HKqWMs9Uidxhmh+MgvWBwqWFU/tT/NKOQ8azCHVz8tV5FWLd7BHrCJTcnevNrLe1cXXC5F9xXVkFRV60JL/WqOm0MOsTLBammLcAeWpKCx91rLt9DQw5v1yTC+TxFrJC/Q2UD1HgHvG8qZq/y0BoiK7VepN9+Vdi6esbYl/A=; 5:bNY4dSHwZXOC3O/RW0Z6CCi/A16XBOo8+36i5NnhxtDhZ26SzTdKhkhNz3PmnfDzW3Kyb7iORYNilfwE2ZSka57s8IbkgjIC4A6gPttnfNlqzaIfYzVEVNpzrg/J7spTrDYbs9Xwd5PLRKh0Of+ncQ95mCHGtn209D8KIfzoDIk=; 24:DdiYjJnh3BLD6RspUMPb018w+BvvcofnV73bKqwN3rugtq/xMCP9m/jfm8FIDQeRIDVT5ut61rohTgd3afRhbpkcvHbKHw1n0CWQ9o0rEw4=; 7:6N68JKnTasJCiG3Ts7PpnbIa74mJ6kddEqmjD8+nwKHTqUj5j/3uyUJ2TitYMblSv2gcO0PR//2GlEonhk/r+iAom6En5wHw6sG1g5AY5PCR3p4GY6ISpAzjJWCn2LKxRsFz5X5AoGHgG7cpjhjZS2ozSwRGZSmhwbZ+cYJbj5/ls3U6SV8xsFTjZ+sUsSGgYO33yt1LiU3wxlOm/H/Rr5Wq3PC5f2sJsWm/VQ75oTTGFMmVDXcaJQA1UweU1IEP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB759; 20:x9Hks1sJvJRfA9GRC9rRhcp5hc7FMRDBsS5fiFzIT4Yp/tPyWIsIkbPTkNxd+SV75IvpS5FV0bVv+kn5DfUIuKIx4Vh5/EucRIEdIbvbhQL8+C8waJfbNLH1cYSKhvVtZpgK9X2wsQJci+ru8/b3bJwaIzxTspj+6kRJws4j7xM= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 14:50:17.1881 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc8baf80-d021-443a-af19-08d557704d1d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB759 Cc: Thomas Hellstrom , linux-graphics-maintainer@vmware.com, stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Buffer objects need to be either pinned or reserved while a map is active, that's not the case here, so avoid caching the framebuffer map. This will cause increasing mapping activity mainly when we don't do page flipping. This fixes occasional garbage filled screens when the framebuffer has been evicted after the map. Since in-kernel mapping of whole buffer objects is error-prone on 32-bit architectures and also quite inefficient, we will revisit this later. Signed-off-by: Thomas Hellstrom Reviewed-by: Sinclair Yeh Cc: --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 ------ drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 41 +++++++++++------------------------- 3 files changed, 13 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 0545740b3724..641294aef165 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -697,7 +697,6 @@ vmw_du_plane_duplicate_state(struct drm_plane *plane) vps->pinned = 0; /* Mapping is managed by prepare_fb/cleanup_fb */ - memset(&vps->guest_map, 0, sizeof(vps->guest_map)); memset(&vps->host_map, 0, sizeof(vps->host_map)); vps->cpp = 0; @@ -760,11 +759,6 @@ vmw_du_plane_destroy_state(struct drm_plane *plane, /* Should have been freed by cleanup_fb */ - if (vps->guest_map.virtual) { - DRM_ERROR("Guest mapping not freed\n"); - ttm_bo_kunmap(&vps->guest_map); - } - if (vps->host_map.virtual) { DRM_ERROR("Host mapping not freed\n"); ttm_bo_kunmap(&vps->host_map); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h index ff9c8389ff21..cd9da2dd79af 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h @@ -175,7 +175,7 @@ struct vmw_plane_state { int pinned; /* For CPU Blit */ - struct ttm_bo_kmap_obj host_map, guest_map; + struct ttm_bo_kmap_obj host_map; unsigned int cpp; }; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index 90b5437fd787..b68d74888ab1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -114,7 +114,7 @@ struct vmw_screen_target_display_unit { bool defined; /* For CPU Blit */ - struct ttm_bo_kmap_obj host_map, guest_map; + struct ttm_bo_kmap_obj host_map; unsigned int cpp; }; @@ -695,7 +695,8 @@ static void vmw_stdu_dmabuf_cpu_commit(struct vmw_kms_dirty *dirty) s32 src_pitch, dst_pitch; u8 *src, *dst; bool not_used; - + struct ttm_bo_kmap_obj guest_map; + int ret; if (!dirty->num_hits) return; @@ -706,6 +707,13 @@ static void vmw_stdu_dmabuf_cpu_commit(struct vmw_kms_dirty *dirty) if (width == 0 || height == 0) return; + ret = ttm_bo_kmap(&ddirty->buf->base, 0, ddirty->buf->base.num_pages, + &guest_map); + if (ret) { + DRM_ERROR("Failed mapping framebuffer for blit: %d\n", + ret); + goto out_cleanup; + } /* Assume we are blitting from Host (display_srf) to Guest (dmabuf) */ src_pitch = stdu->display_srf->base_size.width * stdu->cpp; @@ -713,7 +721,7 @@ static void vmw_stdu_dmabuf_cpu_commit(struct vmw_kms_dirty *dirty) src += ddirty->top * src_pitch + ddirty->left * stdu->cpp; dst_pitch = ddirty->pitch; - dst = ttm_kmap_obj_virtual(&stdu->guest_map, ¬_used); + dst = ttm_kmap_obj_virtual(&guest_map, ¬_used); dst += ddirty->fb_top * dst_pitch + ddirty->fb_left * stdu->cpp; @@ -772,6 +780,7 @@ static void vmw_stdu_dmabuf_cpu_commit(struct vmw_kms_dirty *dirty) vmw_fifo_commit(dev_priv, sizeof(*cmd)); } + ttm_bo_kunmap(&guest_map); out_cleanup: ddirty->left = ddirty->top = ddirty->fb_left = ddirty->fb_top = S32_MAX; ddirty->right = ddirty->bottom = S32_MIN; @@ -1109,9 +1118,6 @@ vmw_stdu_primary_plane_cleanup_fb(struct drm_plane *plane, { struct vmw_plane_state *vps = vmw_plane_state_to_vps(old_state); - if (vps->guest_map.virtual) - ttm_bo_kunmap(&vps->guest_map); - if (vps->host_map.virtual) ttm_bo_kunmap(&vps->host_map); @@ -1277,33 +1283,11 @@ vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane, */ if (vps->content_fb_type == SEPARATE_DMA && !(dev_priv->capabilities & SVGA_CAP_3D)) { - - struct vmw_framebuffer_dmabuf *new_vfbd; - - new_vfbd = vmw_framebuffer_to_vfbd(new_fb); - - ret = ttm_bo_reserve(&new_vfbd->buffer->base, false, false, - NULL); - if (ret) - goto out_srf_unpin; - - ret = ttm_bo_kmap(&new_vfbd->buffer->base, 0, - new_vfbd->buffer->base.num_pages, - &vps->guest_map); - - ttm_bo_unreserve(&new_vfbd->buffer->base); - - if (ret) { - DRM_ERROR("Failed to map content buffer to CPU\n"); - goto out_srf_unpin; - } - ret = ttm_bo_kmap(&vps->surf->res.backup->base, 0, vps->surf->res.backup->base.num_pages, &vps->host_map); if (ret) { DRM_ERROR("Failed to map display buffer to CPU\n"); - ttm_bo_kunmap(&vps->guest_map); goto out_srf_unpin; } @@ -1350,7 +1334,6 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane, stdu->display_srf = vps->surf; stdu->content_fb_type = vps->content_fb_type; stdu->cpp = vps->cpp; - memcpy(&stdu->guest_map, &vps->guest_map, sizeof(vps->guest_map)); memcpy(&stdu->host_map, &vps->host_map, sizeof(vps->host_map)); if (!stdu->defined)