Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3007466pxk; Sun, 6 Sep 2020 23:40:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB47WVwm11UY6vgiZdp26qq0iwtvs1sTxSwNd305qsnHK9zySHuadQqgYfzzy9Hs9S4LDe X-Received: by 2002:a17:906:344e:: with SMTP id d14mr20343324ejb.42.1599460823512; Sun, 06 Sep 2020 23:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599460823; cv=none; d=google.com; s=arc-20160816; b=aYWS2+XpI9QVJLKV5nmW2M/gQ/kzGqMh6RjSYO3Nn3XuqPLdVyeJ8lZLJnKwAU+xbY GuwSkSvmEIEjVL/Je3Nh8A1X7oiNtS+HpZhEpeYeIAkl+5rG4DyKEgtcMs3dYWN11wZp olfrFIY5K8lVARhIvLPKn2VPEdxXug3CGqMVVnQ0oKHkBjQuaY2wk2Zbm236g2czu8+M MzI3jpOijK0+qNwWn7i9zxQQa/9bAtobXqEf0/Mf6arT7tRkjjBdRcAhDWtp6iohBtSU o8EosloMB0rv6y5iDxbhTE0ZTCcBgwpiPZ0c4w84v2/b7l6xDaB67YfaacBYAFYn3yfQ L1jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=eetlFRw0D/x8ec2NAwaNQj2c548Ry8s5O0p6d1F8FMM=; b=Rel+CpF93wfQfkc/+fgkiwIZCM8wwN5mOlgGIebq1BWt345GBiMes916esx/ja0Um1 jOyAnYEFziZIzJTPk0AVd/pgmtHsQRjUIxIefHkdOZpPsIYa1D8Ftugc64qY4++CpLF7 RWoUSWOBMpWQVcQCEAmmsp64VeHbhQK1JlCmlH2PpjI/LEoIcFhzcArYv+ho2Grblw01 9JUgvPd7G2xJiXKA1kBmV4g8oDQAXBy+Uc3Ta5EmqrcIkXhe5UGCfRZuLYHomr1tqcGY IzpQ74FaU/rUGwlH7UGRXA4m87lpc0TJKM2CkfI7pmxbOI0ruC11hQn1tpn/jMnSZMFb 8vcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KjUPOTgo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g24si10099934edu.262.2020.09.06.23.40.01; Sun, 06 Sep 2020 23:40:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KjUPOTgo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726424AbgIGGjP (ORCPT + 99 others); Mon, 7 Sep 2020 02:39:15 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:28622 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726286AbgIGGjN (ORCPT ); Mon, 7 Sep 2020 02:39:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599460751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eetlFRw0D/x8ec2NAwaNQj2c548Ry8s5O0p6d1F8FMM=; b=KjUPOTgoywztcwmRE0RPzfEZ1wHL1P8tjffINIjSYO/ekfkOwAOBCpvhc6KJbj0EQCY2pD fRikaccd0dTk4uWT2/C79vFPIfe0eRji7LkP6HGoFkzxjGz01uo0bR+YYiQP4BSWFy/ATW 8QkP7/r1tiTPeDui0WjWsWq0yhXZ1II= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-472-Im-pi5WkMveRzazWd9YxPQ-1; Mon, 07 Sep 2020 02:39:07 -0400 X-MC-Unique: Im-pi5WkMveRzazWd9YxPQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6C6F2427FD; Mon, 7 Sep 2020 06:39:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83EBB19C4F; Mon, 7 Sep 2020 06:39:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9445C9A83; Mon, 7 Sep 2020 08:39:01 +0200 (CEST) Date: Mon, 7 Sep 2020 08:39:01 +0200 From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org, christian.koenig@amd.com, Alex Deucher , David Airlie , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Lucas Stach , Russell King , Christian Gmeiner , Rob Clark , Sean Paul , Ben Skeggs , Sandy Huang , Heiko =?utf-8?Q?St=C3=BCbner?= , Thierry Reding , Jonathan Hunter , Oleksandr Andrushchenko , "open list:RADEON and AMDGPU DRM DRIVERS" , open list , "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , "moderated list:ARM/Rockchip SoC support" , "open list:ARM/Rockchip SoC support" , "open list:DRM DRIVERS FOR NVIDIA TEGRA" , "moderated list:DRM DRIVERS FOR XEN" Subject: Re: [PATCH v2 1/2] drm: allow limiting the scatter list size. Message-ID: <20200907063901.atwjdxz7iqyra22h@sirius.home.kraxel.org> References: <20200818092017.26290-1-kraxel@redhat.com> <20200818092017.26290-2-kraxel@redhat.com> <20200901074043.GT2352366@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200901074043.GT2352366@phenom.ffwll.local> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > + /** > > + * @max_segment: > > + * > > + * Max size for scatter list segments. When unset the default > > + * (SCATTERLIST_MAX_SEGMENT) is used. > > + */ > > + size_t max_segment; > > Is there no better place for this then "at the bottom"? drm_device is a > huge structure, piling stuff up randomly doesn't make it better :-) Moved next to the other gem fields for now (v3 posted). > I think ideally we'd have a gem substruct like we have on the modeset side > at least. Phew, that'll be quite some churn in the tree. And there aren't that many gem-related fields in struct drm_device. So you are looking for something like below (header changes only)? take care, Gerd diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h index c455ef404ca6..950167ede98a 100644 --- a/include/drm/drm_device.h +++ b/include/drm/drm_device.h @@ -299,22 +299,8 @@ struct drm_device { /** @mode_config: Current mode config */ struct drm_mode_config mode_config; - /** @object_name_lock: GEM information */ - struct mutex object_name_lock; - - /** @object_name_idr: GEM information */ - struct idr object_name_idr; - - /** @vma_offset_manager: GEM information */ - struct drm_vma_offset_manager *vma_offset_manager; - - /** - * @max_segment: - * - * Max size for scatter list segments for GEM objects. When - * unset the default (SCATTERLIST_MAX_SEGMENT) is used. - */ - size_t max_segment; + /** @gem_config: Current GEM config */ + struct drm_gem_config gem_config; /** @vram_mm: VRAM MM memory manager */ struct drm_vram_mm *vram_mm; diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 337a48321705..74129fb29fb8 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -39,6 +39,25 @@ #include +struct drm_gem_config { + /** @object_name_lock: GEM information */ + struct mutex object_name_lock; + + /** @object_name_idr: GEM information */ + struct idr object_name_idr; + + /** @vma_offset_manager: GEM information */ + struct drm_vma_offset_manager *vma_offset_manager; + + /** + * @max_segment: + * + * Max size for scatter list segments for GEM objects. When + * unset the default (SCATTERLIST_MAX_SEGMENT) is used. + */ + size_t max_segment; +}; + struct drm_gem_object; /**