Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys



Maybe I'm reading this wrong, but it looks like wsdisplay passes the
struct wsscreen *scr in to the driver for this "cookie", in
wsdisplay_internal_ioctl (see wsdisplay.c line 1081.)

So maybe the "opaque" value from the driver (the cookie) isn't being
passed as you think it is?

    -- Garrett

Michael Lorenz wrote:
> Hello,
>
>   
>> Okay, I have a concern this.  As far as I can tell, the cookie is
>> passed to the driver, but I cannot see how the driver can make sense
>> of it.  The cookie that wsdisplay passes seems to be a struct
>> wsscreen, which is a private structure to wsdisplay(4) -- it is not
>> declared in any external headers.
>>     
>
> struct wsscreen is not really defined anywhere I can see. What you get
> in ioctl() and mmap() is supposedly the screen struct your
> alloc_screen() method produced ( or vcons_alloc_screen(), in this case
> it's a struct vcons_screen * ). Since its content is driver specific
> it's handled as opaque cookie in wsdisplay.c
>
>   
>> So how is a display driver (e.g. machfb, or more to the point, my
>> radeonfb driver) supposed to use this member argument? 
>>     
>
> Cast it to your driver-specific struct screen.
>
>   
>> Pass an opaque cookie is useless to the driver unless there is some
>> way for the driver to do something meaningful with it.
>>     
>
> The driver defines this cookie, it's opaque to anyone /but/ the driver.
>
> have fun
> Michael
>   


-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191




Home | Main Index | Thread Index | Old Index