All of lore.kernel.org
 help / color / mirror / Atom feed
* kconfig/build question..
@ 2004-11-10  1:16 Dave Airlie
  2004-11-10  2:09 ` Adrian Bunk
  2004-11-10 11:55 ` Roman Zippel
  0 siblings, 2 replies; 6+ messages in thread
From: Dave Airlie @ 2004-11-10  1:16 UTC (permalink / raw)
  To: linux-kernel


I've come across something that I'm not sure Kconfig can do but I'll
explain what I need and see what others can come up with...

The DRM has a weak dependency on AGP, it does not require AGP for all
situations but can use it in most...

So what I want to do and what I think Kbuild can't do is:

if CONFIG_AGP=n then CONFIG_DRM can be n,m,y
if CONFIG_AGP=m then CONFIG_DRM can be m but not y
if CONFIG_AGP=y then CONFIG_DRM can be m,y

This also needs to work for oldconfigs if it can be enforced, so someone
who has a valid config now of CONFIG_AGP=m, CONFIG_DRM=y will be
questioned...

I'm thinking I could change the name of CONFIG_DRM to CONFIG_DRM_CORE and
just use the default rules, if the worst comes to the worst...

Dave.

-- 
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
pam_smb / Linux DECstation / Linux VAX / ILUG person


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

* Re: kconfig/build question..
  2004-11-10  1:16 kconfig/build question Dave Airlie
@ 2004-11-10  2:09 ` Adrian Bunk
  2004-11-10 11:55 ` Roman Zippel
  1 sibling, 0 replies; 6+ messages in thread
From: Adrian Bunk @ 2004-11-10  2:09 UTC (permalink / raw)
  To: Dave Airlie; +Cc: linux-kernel

On Wed, Nov 10, 2004 at 01:16:10AM +0000, Dave Airlie wrote:
> 
> I've come across something that I'm not sure Kconfig can do but I'll
> explain what I need and see what others can come up with...
> 
> The DRM has a weak dependency on AGP, it does not require AGP for all
> situations but can use it in most...
> 
> So what I want to do and what I think Kbuild can't do is:
> 
> if CONFIG_AGP=n then CONFIG_DRM can be n,m,y
> if CONFIG_AGP=m then CONFIG_DRM can be m but not y
> if CONFIG_AGP=y then CONFIG_DRM can be m,y
>...

The second case is bad because enabling a module shouldn't change the 
static parts of the kernel [1].

Let me suggest a slightly different solution:

I assume a "weak dependency" dependency means you can enable some AGP 
specific code in the DRM code?

config DRM_AGP
	bool
	depends on ((DRM = "m" && AGP) || (DRM = "y" && AGP = "y"))
	default y

In the DRM code, you #ifdef CONFIG_DRM_AGP the AGP specific code.

This way, CONFIG_AGP=m and CONFIG_DRM=y is a legal configuration but 
doesn't enable the AGP specific code in the DRM code.

> Dave.

cu
Adrian

[1] yes, this isn't always true in the current kernel

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: kconfig/build question..
  2004-11-10  1:16 kconfig/build question Dave Airlie
  2004-11-10  2:09 ` Adrian Bunk
@ 2004-11-10 11:55 ` Roman Zippel
  2004-11-11 10:16   ` Dave Airlie
  2004-11-12 18:40   ` Adrian Bunk
  1 sibling, 2 replies; 6+ messages in thread
From: Roman Zippel @ 2004-11-10 11:55 UTC (permalink / raw)
  To: Dave Airlie; +Cc: linux-kernel

Hi,

On Wed, 10 Nov 2004, Dave Airlie wrote:

> So what I want to do and what I think Kbuild can't do is:
> 
> if CONFIG_AGP=n then CONFIG_DRM can be n,m,y
> if CONFIG_AGP=m then CONFIG_DRM can be m but not y
> if CONFIG_AGP=y then CONFIG_DRM can be m,y

Do you really want to say that DRM can't be disabled if AGP is enabled?
Otherwise this should do it:

	depends on AGP || AGP=n

bye, Roman

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

* Re: kconfig/build question..
  2004-11-10 11:55 ` Roman Zippel
@ 2004-11-11 10:16   ` Dave Airlie
  2004-11-12 18:40   ` Adrian Bunk
  1 sibling, 0 replies; 6+ messages in thread
From: Dave Airlie @ 2004-11-11 10:16 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Dave Airlie, linux-kernel

> 
> Do you really want to say that DRM can't be disabled if AGP is enabled?
> Otherwise this should do it:
> 
>         depends on AGP || AGP=n
> 

Thanks Roman, I think that is the solution I was looking for...

Dave.

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

* Re: kconfig/build question..
  2004-11-10 11:55 ` Roman Zippel
  2004-11-11 10:16   ` Dave Airlie
@ 2004-11-12 18:40   ` Adrian Bunk
  2004-11-13  6:10     ` Dave Airlie
  1 sibling, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2004-11-12 18:40 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Dave Airlie, linux-kernel

On Wed, Nov 10, 2004 at 12:55:32PM +0100, Roman Zippel wrote:
> Hi,
> 
> On Wed, 10 Nov 2004, Dave Airlie wrote:
> 
> > So what I want to do and what I think Kbuild can't do is:
> > 
> > if CONFIG_AGP=n then CONFIG_DRM can be n,m,y
> > if CONFIG_AGP=m then CONFIG_DRM can be m but not y
> > if CONFIG_AGP=y then CONFIG_DRM can be m,y
> 
> Do you really want to say that DRM can't be disabled if AGP is enabled?
> Otherwise this should do it:
> 
> 	depends on AGP || AGP=n

I dislike this solution.

consider:
AGP=n
DRM=y

If the user then adds modular AGP to his kernel this will cause DRM=m 
which might cause problems if he tries to use these modules.

I'm still of the opinion that adding a module shoudn't change the 
static kernel.

> bye, Roman

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: kconfig/build question..
  2004-11-12 18:40   ` Adrian Bunk
@ 2004-11-13  6:10     ` Dave Airlie
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Airlie @ 2004-11-13  6:10 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Roman Zippel, linux-kernel


> I dislike this solution.
>
> consider:
> AGP=n
> DRM=y
>
> If the user then adds modular AGP to his kernel this will cause DRM=m
> which might cause problems if he tries to use these modules.

This is exactly what we want to happen, if AGP is there, DRM should use it
no matter what, and if AGP is a module, DRM has to be... it isn't pretty
maybe but I think the DRM-AGP relationship is rather complicated, I'm
probably going to add some output to the drm init string to say whether it
knows about AGP or not ...

Dave.


-- 
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
pam_smb / Linux DECstation / Linux VAX / ILUG person


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

end of thread, other threads:[~2004-11-13  6:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-10  1:16 kconfig/build question Dave Airlie
2004-11-10  2:09 ` Adrian Bunk
2004-11-10 11:55 ` Roman Zippel
2004-11-11 10:16   ` Dave Airlie
2004-11-12 18:40   ` Adrian Bunk
2004-11-13  6:10     ` Dave Airlie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.