Custom KMS driver + X
Eric Anholt
eric at anholt.net
Thu Jul 14 19:28:56 UTC 2016
Jose Abreu <Jose.Abreu at synopsys.com> writes:
> Hi Adam,
>
> Thanks for your answer!
>
>
> On 06-07-2016 15:57, Adam Jackson wrote:
>> On Tue, 2016-07-05 at 15:28 +0100, Jose Abreu wrote:
>>
>>> - First: My driver only supports 24 bpp (I mean real 24
>>> bits, not 24 packed in 32 bits). Is there a way to specify to X
>>> (or specify in the driver itself) to use 24bpp **only** in the
>>> new driver that I created?
>> Kind of. The arguments to xf86SetDepthBpp (which you're probably
>> calling in your PreInit hook) specify how the root window is to be
>> treated. If you can only do 24bpp, you'll want to pass Support24bppFb
>> (and nothing else) as the last argument. By default (ie, without exa or
>> glamor or other acceleration) other pixmaps will be created in host
>> memory as 32bpp, and the software renderer will convert between formats
>> as needed. If you want to add support for pixmaps in video memory
>> you'll need to enforce the 24bpp restriction in your accel support
>> code.
>
> Ok, something is missing because I am not calling
> xf86SetDetpthBpp at all. You mean I need to have a X driver (or
> module, I don't know the nomenclature) in order to use my KMS
> driver? Can't I just use the 'modesetting' driver? Sorry if I am
> making some dumb mistake but my understanding of the inner
> workings of X is barely null.
>
> Right now I am able to force X to use 24bpp in the KMS driver. I
> just return -EINVAL in the dumb_create() callback of DRM when the
> bpp is not 24 and then X tries again with the right bpp, but when
> I do this the X stops working and in the log it appears the stack
> trace that I sent in the first email.
Yeah, I would think that updating the modesetting driver would be the
way to go. You could probably use drmModeGetPlaneResources() /
drmModeGetPlane() to figure out what formats are supported on the
primary plane and adjust xf86SetDepthBpp() according to what it returns.
That said, you're going to be so much better off if you can possibly do
32bpp instead.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160714/bbdc11b7/attachment.sig>
More information about the xorg-devel
mailing list