public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: sis_malloc / sis_free
@ 2002-02-20 18:25 Thomas Winischhofer
  2002-02-20 19:20 ` Jean Paul Sartre
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas Winischhofer @ 2002-02-20 18:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jean Paul Sartre

On Wed, 20 Feb 2002, Christoph Pittracher wrote: 
> > Hello! 

Hi everyone,

> > Yes, the sisfb/drm code has some design lacks.

Well, well. I have by now come to the conclusion that this isn't really
the case...

> > Another lack is the necessary memory offset between framebuffer/drm and
> > the X driver (see http://www.webit.at/~twinny/linuxsis630.shtml for
> > details). 
>
> Oh, okay. Should that memory offset be a source of processor time
> waste for allocating memory when switching through FB and X, for an
> example? If so, sharing the code (instead of duplicating it) is the ideal
> approach. 

This has nothing whatsoever with processor time to do. It's to keep
DRM/DRI from overwriting X's screen and off-screen buffers.

> > I don't think that it would be a problem to duplicate the code. the
> > sis_malloc / sis_free functions seems quite stable. I don't think that
> > there will be big updates for this code. 
>
> Hmm, but as you stated, I do not think code duplication should be
> the best approach. 

No, it would not. You've obviously not understood the problems.

It's not done by simply duplicating the sis_malloc/sis_free functions as
these also require

- detecting the type and size of the memory (of many different SiS
chipsets),

- initializing a heap (based on which you later allocate/free the
memory) taking into account a possibe TurboQueue, a possible AGP command
queue and the HWCursor memory area.

Believe me: I know the code by heart right now, and moving the memory
management out of the framebuffer driver will require HUGE parts of the
code copied (not speaking about maintainance issues).

Finally: I intend to implement (real) 2D accelleration in the
framebuffer driver. Thus, I will need a >common< memory management (ie.
ONE SINGLE heap) for both the framebuffer driver as well as the X
driver. Otherwise these two will again overwrite each others video
memory, very possibly leading into problems with the accellerator
engines (which use parts of the video RAM for buffering). 

This can only be avoided by keeping the memory management inside the
framebuffer driver. I don't think it's good to be forced to load the DRM
module (if that one then contains memory management) for only being able
to use the framebuffer driver...

> > Thomas Winischhofer <tw@webit.com> is working on that SiS stuff for
> > about 2 months. I think it would be best if you contact him and ask
> > what he thinks about that. I know that he said it would be a good idea
> > to seperate the sisfb and sis_drm code but he doesn't have enough time
> > to do it... 

It's not a time issue. As said, the concept isn't that bad for future
development. I consider it wise enough to keep the drivers separated, as
this also allows separate usage (framebuffer only, X only) without
memory clashes.

> If I have such time, I'll contact him. But for the moment, if the
> code does not compile (still with 2.4.18-rc2-ac1) I'll duplicate the code
> to get it working until a better solution raises.

You don't have to do that. If you don't like a graphical console, simple
start the framebuffer driver with "mode=none" (or as a kernel parameter
"mode:none"). In this case, sisfb will only initialize the memory but
leave the console alone.

I don't recommend changing anything that big in the framebuffer driver
at the moment. I am currently in close contact with SiS who help me
fixing the (still) remaining problems with it - based on the existing
code. In the very only case you'd like to reinclude a number of changes
for a number of times - well, go ahead :)

Thomas

-- 
Thomas Winischhofer
Vienna/Austria
mailto:tw@webit.com                  *** http://www.webit.com/tw

^ permalink raw reply	[flat|nested] 15+ messages in thread
* sis_malloc / sis_free
@ 2002-02-20  1:26 Jean Paul Sartre
  2002-02-20  1:47 ` Christoph Pittracher
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jean Paul Sartre @ 2002-02-20  1:26 UTC (permalink / raw)
  To: Linux Kernel Mailing List

	Hello all.

	I was grepping through the SIS malloc/free code and I saw DRM
'shares' code with the fb code. What if I have SIS framebuffer disabled
and SIS DRM code enabled? In 2.4.18-rc2, the SIS DRM code does not compile
from the lack of sis_malloc and sis_free function.

	I would suggest 'duplicating' this code (yes, I *do* hate
duplicating codes) or making that memory allocation code *really* shared
between both modules (or we won't be able to successfully compile it,
since the DRM code is on drivers/char/drm and the FB code is on
drivers/video/sis/sis_main.c).

	If the suggestion of 'duplicating' code (argh) is reasonable
enough (for they are really different codes) I can work and submit a
patch. If not, I do not know how to 'share' both codes without tweaking
through the makefiles and dependencies (which should also compile extra
code that is not needed in the DRM code).

	Regards,
	Cesar Suga <sartre@linuxbr.com>



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-02-20 22:33 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-20 18:25 sis_malloc / sis_free Thomas Winischhofer
2002-02-20 19:20 ` Jean Paul Sartre
2002-02-20 20:49   ` Thomas Winischhofer
2002-02-20 22:31     ` Cesar Suga
  -- strict thread matches above, loose matches on Subject: below --
2002-02-20  1:26 Jean Paul Sartre
2002-02-20  1:47 ` Christoph Pittracher
2002-02-20  2:17   ` Jean Paul Sartre
2002-02-20  1:51 ` Alan Cox
2002-02-20  1:40   ` Jean Paul Sartre
2002-02-20  2:14     ` Alan Cox
2002-02-20  2:11       ` Jean Paul Sartre
2002-02-20  2:28         ` Alan Cox
2002-02-20  1:45   ` Jean Paul Sartre
2002-02-20 16:43 ` James Simmons
2002-02-20 17:08   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox