From patchwork Tue Oct 22 20:47:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 11205357 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 291B014E5 for ; Tue, 22 Oct 2019 20:47:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F01D2086D for ; Tue, 22 Oct 2019 20:47:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F01D2086D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED2226E0A2; Tue, 22 Oct 2019 20:47:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by gabe.freedesktop.org (Postfix) with ESMTPS id D2B5C6E0A2 for ; Tue, 22 Oct 2019 20:47:35 +0000 (UTC) Received: by mail-yb1-xb44.google.com with SMTP id t4so5610270ybk.3 for ; Tue, 22 Oct 2019 13:47:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TKSWa6+W9chr3MXgK1rGOFpa9znkmU6hlRR+y3nk7e0=; b=FXk01FF6dMcKfN/84QzATt1HJs5DPLXCH1yObu5QRC9sH3oZNDnaVockG62KEfJdqf d9j/j4uo3caGgCv5cJABofNOucsmeFjQqM3Ug+AyD9XeUr10J62uOkJOtHjs9f1e5xbn JEuO0bUGS/OoGfN0MGaNjMhWZNpNhWGzR5C3a+2nTOd12CHJMB1Sle1WZyguVKKMyvVn 5SRO1tm7vvYCPPUo8teYFz4hyX9gdzf/DJk45n17bAnrUUacglrda152BoteEXYbSINA Yz+/mn+652yeL6f+hcdhOzF/6mK/7ugWrQQo5SHjbzGYApcG25iZPsnpEznUFJmGb1Qh J12g== X-Gm-Message-State: APjAAAUZ8T6FxjCqaYPzlPojZ2azLW4HKI5GkqQRHJTMIfmpfDMxJPHW EkAQJwDPNnxV20/+21HKWqlPovnrDgg= X-Google-Smtp-Source: APXvYqzWNEgIeVqKIpCKihFlrJnMysISEAflQRY/RtOY9R5Ft/hLELeZRG19TKJ3vqq61MAaq3y7KA== X-Received: by 2002:a25:c5c9:: with SMTP id v192mr3974610ybe.301.1571777254656; Tue, 22 Oct 2019 13:47:34 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id c198sm3926145ywa.78.2019.10.22.13.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 13:47:34 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH] Revert "drm/omap: add OMAP_BO flags to affect buffer allocation" Date: Tue, 22 Oct 2019 16:47:29 -0400 Message-Id: <20191022204733.235801-1-sean@poorly.run> X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TKSWa6+W9chr3MXgK1rGOFpa9znkmU6hlRR+y3nk7e0=; b=T1Aub44bCbvgfxHPUfG7+nj+ioMV9sA3SMHCaLlLQLUaqNvQ4ja84mm/Jm2+AMp4IE x8f0QKMSx7zxVanJLdnnrKY6jhJ2jvHiBTeS3fsq6cJSCQxh8jhpYMgmcNea/AwjDBne qkj1TrfZeI+rrjmUs17kIeCLAtqXh3AFJABOPZbPPa2G3JVbHHNC5p0Cg06CNfFxJqPZ EJu58isgKeIqBJLZXgyNNFOomrsU1STayoTqYOMUbX/MtIS6Qm63LwlrIZonaR9GVGp4 /Le6wFEMpn/Gw3CkKYzkc000GmQYqNSTMsEFpeq7uxrtRWDf7kZBEqWxj16A0eEXVJwF 19fw== 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: David Airlie , Jean-Jacques Hiblot , Tomi Valkeinen , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 23b482252836ab3c5e6b3b20ed3038449cbc7679. This patch does not have an acceptable open source userspace implementation, and as such it does not meet the requirements for adding new UAPI. Discussion is in the Link. Link: https://lists.freedesktop.org/archives/dri-devel/2019-October/240586.html Fixes: 23b482252836 ("drm/omap: add OMAP_BO flags to affect buffer allocation") Cc: Tomi Valkeinen Cc: Jean-Jacques Hiblot Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Signed-off-by: Sean Paul Acked-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_gem.c | 54 ++---------------------------- include/uapi/drm/omap_drm.h | 9 ----- 2 files changed, 2 insertions(+), 61 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index bf18dfe2b689..e518d93ca6df 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -1097,9 +1097,6 @@ void omap_gem_free_object(struct drm_gem_object *obj) list_del(&omap_obj->mm_list); mutex_unlock(&priv->list_lock); - if (omap_obj->flags & OMAP_BO_MEM_PIN) - omap_gem_unpin_locked(obj); - /* * We own the sole reference to the object at this point, but to keep * lockdep happy, we must still take the omap_obj_lock to call @@ -1150,19 +1147,10 @@ static bool omap_gem_validate_flags(struct drm_device *dev, u32 flags) return false; } - if ((flags & OMAP_BO_MEM_CONTIG) && (flags & OMAP_BO_MEM_DMM)) - return false; - - if ((flags & OMAP_BO_MEM_DMM) && !priv->usergart) - return false; - if (flags & OMAP_BO_TILED_MASK) { if (!priv->usergart) return false; - if (flags & OMAP_BO_MEM_CONTIG) - return false; - switch (flags & OMAP_BO_TILED_MASK) { case OMAP_BO_TILED_8: case OMAP_BO_TILED_16: @@ -1177,34 +1165,7 @@ static bool omap_gem_validate_flags(struct drm_device *dev, u32 flags) return true; } -/** - * omap_gem_new() - Create a new GEM buffer - * @dev: The DRM device - * @gsize: The requested size for the GEM buffer. If the buffer is tiled - * (2D buffer), the size is a pair of values: height and width - * expressed in pixels. If the buffers is not tiled, it is expressed - * in bytes. - * @flags: Flags give additionnal information about the allocation: - * OMAP_BO_TILED_x: use the TILER (2D buffers). The TILER container - * unit can be 8, 16 or 32 bits. Cache is always disabled for - * tiled buffers. - * OMAP_BO_SCANOUT: Scannout buffer, consummable by the DSS - * OMAP_BO_CACHED: Buffer CPU caching mode: cached - * OMAP_BO_WC: Buffer CPU caching mode: write-combined - * OMAP_BO_UNCACHED: Buffer CPU caching mode: uncached - * OMAP_BO_MEM_CONTIG: The driver will use dma_alloc to get the memory. - * This can be used to avoid DMM if the userspace knows it needs - * more than 128M of memory at the same time. - * OMAP_BO_MEM_DMM: The driver will use DMM to get the memory. There's - * not much use for this flag at the moment, as on platforms with - * DMM it is used by default, but it's here for completeness. - * OMAP_BO_MEM_PIN: The driver will pin the memory at alloc time, and - * keep it pinned. This can be used to 1) get an error at alloc - * time if DMM space is full, and 2) get rid of the constant - * pin/unpin operations which may have some effect on performance. - * - * Return: The GEM buffer or NULL if the allocation failed - */ +/* GEM buffer object constructor */ struct drm_gem_object *omap_gem_new(struct drm_device *dev, union omap_gem_size gsize, u32 flags) { @@ -1232,8 +1193,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev, */ flags &= ~(OMAP_BO_CACHED|OMAP_BO_WC|OMAP_BO_UNCACHED); flags |= tiler_get_cpu_cache_flags(); - } else if ((flags & OMAP_BO_MEM_CONTIG) || - ((flags & OMAP_BO_SCANOUT) && !priv->has_dmm)) { + } else if ((flags & OMAP_BO_SCANOUT) && !priv->has_dmm) { /* * If we don't have DMM, we must allocate scanout buffers * from contiguous DMA memory. @@ -1293,22 +1253,12 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev, goto err_release; } - if (flags & OMAP_BO_MEM_PIN) { - ret = omap_gem_pin(obj, NULL); - if (ret) - goto err_free_dma; - } - mutex_lock(&priv->list_lock); list_add(&omap_obj->mm_list, &priv->obj_list); mutex_unlock(&priv->list_lock); return obj; -err_free_dma: - if (flags & OMAP_BO_MEM_DMA_API) - dma_free_wc(dev->dev, size, omap_obj->vaddr, - omap_obj->dma_addr); err_release: drm_gem_object_release(obj); err_free: diff --git a/include/uapi/drm/omap_drm.h b/include/uapi/drm/omap_drm.h index 842d3180a442..5a142fad473c 100644 --- a/include/uapi/drm/omap_drm.h +++ b/include/uapi/drm/omap_drm.h @@ -47,15 +47,6 @@ struct drm_omap_param { #define OMAP_BO_UNCACHED 0x00000004 #define OMAP_BO_CACHE_MASK 0x00000006 -/* Force allocation from contiguous DMA memory */ -#define OMAP_BO_MEM_CONTIG 0x00000008 - -/* Force allocation via DMM */ -#define OMAP_BO_MEM_DMM 0x00000010 - -/* Pin the buffer when allocating and keep pinned */ -#define OMAP_BO_MEM_PIN 0x00000020 - /* Use TILER for the buffer. The TILER container unit can be 8, 16 or 32 bits. */ #define OMAP_BO_TILED_8 0x00000100 #define OMAP_BO_TILED_16 0x00000200