[PATCH] modesetting: add support for background none.

Eric Anholt eric at anholt.net
Mon Mar 14 02:55:16 UTC 2016


Dave Airlie <airlied at gmail.com> writes:

> From: Dave Airlie <airlied at redhat.com>
>
> This adds support using glamor for background None.
>
> loosely based off the amdgpu code. relies on the
> glamor_finish code.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  hw/xfree86/drivers/modesetting/driver.c          |  21 +++++
>  hw/xfree86/drivers/modesetting/driver.h          |   2 +-
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 102 +++++++++++++++++------
>  hw/xfree86/drivers/modesetting/drmmode_display.h |   4 +-
>  4 files changed, 103 insertions(+), 26 deletions(-)
>
> diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
> index 8f60eae..3895aca 100644
> --- a/hw/xfree86/drivers/modesetting/driver.c
> +++ b/hw/xfree86/drivers/modesetting/driver.c
> @@ -1099,6 +1099,22 @@ SetMaster(ScrnInfoPtr pScrn)
>  }
>  

I would have expected the copy to be in CreateScreenResources, but I'm
probably just missing something about the fine init sequence.

It's also a bit unfortunate that we have to glamor_finish immediately
after the copy so that we don't modeset to a not-yet-finished pixmap,
since we're delaying the modeset until later anyway.  I think that's a
limitation of our non-pageflip modesetting API, though.

Still, if this is how other drivers have been doing this, it's fine with
me.

It would be nice to give this the comment from another driver:

/* When the root window is created, initialize the screen contents from
 * console if -background none was specified on the command line
 */

which explains a bit why this weird thing is stuffed in CreateWindow.

>  static Bool
> +CreateWindow_oneshot(WindowPtr pWin)
> +{
> +    ScreenPtr pScreen = pWin->drawable.pScreen;
> +    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
> +    modesettingPtr ms = modesettingPTR(pScrn);
> +    Bool ret;
> +
> +    pScreen->CreateWindow = ms->CreateWindow;
> +    ret = pScreen->CreateWindow(pWin);
> +
> +    if (ret)
> +        drmmode_copy_fb(pScrn, &ms->drmmode);
> +    return ret;
> +}
> +

With that,

Acked-by: Eric Anholt <eric at anholt.net>
-------------- 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/20160313/52e4bf7d/attachment.sig>


More information about the xorg-devel mailing list