From: Jerome Glisse <glisse@freedesktop.org>
To: "Thomas Hellström" <thomas@shipmail.org>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.sf.net
Subject: Re: ttm_mem_global
Date: Wed, 29 Jul 2009 10:59:33 +0200 [thread overview]
Message-ID: <1248857973.2426.6.camel@localhost> (raw)
In-Reply-To: <4A6F498E.8090601@shipmail.org>
On Tue, 2009-07-28 at 20:55 +0200, Thomas Hellström wrote:
> Jerome Glisse skrev:
> > On Wed, 2009-07-22 at 10:37 +0200, Thomas Hellström wrote:
> >
> >> TTM has a device struct per device and an optional global struct that is
> >> common for all devices and intended to be per subsystem.
> >>
> >> The only subsystem currently having a global structure is the memory
> >> accounting subsystem:
> >> struct ttm_mem_global
> >>
> >
> > Thomas i don't think the way we init ttm_mem_global today make
> > it follow the 1 struct ttm_mem_global for everyone. I think it
> > should be initialized and refcounted by device struct.
> >
> > So on first device creation a ttm_mem_global is created and
> > then anytime a new device is created the refcount of ttm_mem_global
> > is increased.
> Jerome,
> This is exactly what the current code intends to do.
>
> Are you seeing something different?
I definitly don't see that :) In radeon we do create a structure
which hold the ttm_mem_global struct so it's not shared at all
it got inited & destroyed along the driver. This is why i think
it's better to remove the driver initialization and let bo_device
init path take care of initializing one and only one object which
can be shared by multiple driverttm_mem_global_inits.
So what i propose is remove mem_glob parameter from :
ttm_bo_device_init, add a call to ttm_mem_global_init in
ttm_bo_device_init and add some static refcount in ttm_memory.c
if refcount = 0 then ttm_mem_global_init create a ttm_mem_global
struct and initialize things, if refcount > 0 then it gives
back the already initialized ttm_mem_global.
Of course we unref with ttm_mem_global_release and destroy
once refcount reach 0.
Cheers,
Jerome
next prev parent reply other threads:[~2009-07-29 9:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-25 12:01 TTM page pool allocator Jerome Glisse
2009-06-25 15:53 ` Thomas Hellström
2009-07-21 17:34 ` Jerome Glisse
2009-07-21 18:00 ` Jerome Glisse
2009-07-21 19:22 ` Jerome Glisse
2009-07-22 8:37 ` Thomas Hellström
2009-07-28 16:48 ` ttm_mem_global Jerome Glisse
2009-07-28 18:55 ` ttm_mem_global Thomas Hellström
2009-07-29 8:59 ` Jerome Glisse [this message]
2009-07-29 9:39 ` ttm_mem_global Thomas Hellström
2009-07-29 13:04 ` ttm_mem_global Jerome Glisse
2009-07-22 13:16 ` TTM page pool allocator Michel Dänzer
2009-07-22 13:31 ` Jerome Glisse
2009-07-22 19:13 ` Thomas Hellström
2009-07-22 22:35 ` Jerome Glisse
2009-07-22 23:24 ` Keith Whitwell
2009-07-22 23:27 ` Dave Airlie
2009-07-22 8:27 ` Thomas Hellström
2009-07-22 12:12 ` Jerome Glisse
2009-07-22 19:10 ` Thomas Hellström
2009-06-26 0:00 ` Dave Airlie
2009-06-26 6:31 ` Thomas Hellström
2009-06-26 7:33 ` Jerome Glisse
2009-06-26 7:31 ` Jerome Glisse
2009-06-26 7:38 ` Dave Airlie
2009-06-26 13:59 ` Jerome Glisse
2009-06-29 21:12 ` Thomas Hellström
2009-07-09 6:06 ` Dave Airlie
2009-07-09 8:48 ` Michel Dänzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1248857973.2426.6.camel@localhost \
--to=glisse@freedesktop.org \
--cc=dri-devel@lists.sf.net \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas@shipmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox