Re: [RFC 1/3] drm: Add a way to iterate over minors

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

 



Hey

On Wed, Aug 10, 2016 at 4:34 PM, Daniel Vetter <daniel@xxxxxxxx> wrote:
> On Wed, Aug 10, 2016 at 4:27 PM, Noralf Trønnes <noralf@xxxxxxxxxxx> wrote:
>> Den 10.08.2016 10:43, skrev Daniel Vetter:
>>>
>>> On Tue, Aug 09, 2016 at 07:45:40PM +0200, Noralf Trønnes wrote:
>>>>
>>>> This adds a way for in-kernel users to iterate over the available
>>>> DRM minors. The implementation is oops safe so the panic code
>>>> can safely use it.
>>>>
>>>> Signed-off-by: Noralf Trønnes <noralf@xxxxxxxxxxx>
>>>
>>> Why iterate over minors? I'd kinda have expected we'd iterate over devices
>>> instead ... And looking ahead, that seems to be what you actually want.
>>
>>
>> I did this because I couldn't find a list of drm_devices anywhere. Only
>> minors.
>> But I can do a drm_for_each_device() based on the minor "list".
>
> Hm, the drm drivers are all part of the drm class, we should be able
> to iterate them I think. Otherwise let's just add a new list instead
> of jumping through hoops.
> New list with it's own lock (which we then trylock from the panic
> handler) would be safest I think.

You can use class_for_each_device() (or register a class_interface to
be notified of new entries as well). However, that will iterate all
minors, so you need to filter for the primary one. I think that should
be sufficient, no need for a separate list.

Thanks
David
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux