VT console blank ignored by DRM drivers on QEMU

Daniel Vetter daniel at ffwll.ch
Tue Jul 11 20:36:12 UTC 2017


On Tue, Jul 11, 2017 at 8:10 PM, Takashi Iwai <tiwai at suse.de> wrote:
> On Tue, 11 Jul 2017 19:35:36 +0200,
> Daniel Vetter wrote:
>>
>> On Mon, Jul 10, 2017 at 4:56 PM, Daniel Vetter <daniel at ffwll.ch> wrote:
>> > On Mon, Jul 10, 2017 at 11:37 AM, Takashi Iwai <tiwai at suse.de> wrote:
>> >>> DPMS should be an error anyway, we want that to be able to properly
>> >>> thread the acquire_ctx EDEADLK backoff stuff through that we need for
>> >>> atomic. That would be the best long-term plan I think.
>> >>
>> >> So it implies the conversions of the whole legacy stuff?
>> >> That'd be great but take a long way :)
>> >>
>> >>> But aside from that, can't we just teach these drivers to properly do
>> >>> dpms? With the atomic framework dpms is implement as simply turning
>> >>> the screen off, any driver should be able to support that properly.
>> >>
>> >> It seems that QEMU doesn't support it yet?  We'd need to implement it
>> >> at first there.
>> >
>> > I meant to say that adding an error code to the dpms callback seems
>> > like a good idea, because we need that anyway. You can ignore the
>> > blabla about why exactly atomic drivers need it, and ofc I'm not going
>> > to suggest that you convert all your drivers over to atomic first.
>>
>> I just realized that we've switched the dpms callback from void to int
>> return type a while ago. So only thing you'd need to do is wire up the
>> return code through the fbdev helpers, and fix up the virtual drivers
>> to not allow dpms.
>
> Hmm, as of 4.13-rc1, I see some inconsistencies:
>
> In drm_connector.h:
> struct drm_connector_funcs {
>         int (*dpms)(struct drm_connector *connector, int mode);

This is the driver interface.

> In drm_encoder_slave.h:
> struct drm_encoder_slave_funcs {
>         void (*dpms)(struct drm_encoder *encoder, int mode);
>
> In drm_modeset_helper_vtables.h:
> struct drm_crtc_helper_funcs {
>         void (*dpms)(struct drm_crtc *crtc, int mode);
>
> struct drm_encoder_helper_funcs {
>         void (*dpms)(struct drm_encoder *encoder, int mode);

These are just helpers used by the legacy modeset infrastructure and
deprecated in atomic. As long as you overwrite the connector->dmps
function with your own special one you can return an error code.

You still have to carry around the dummy functions doing nothing,
because the legacy helpers suck that way (and I'm definitely not going
to spend timing cleaning them up, just port to atomic instead).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list