diff mbox

[Mesa-dev] wsi_common_display: Deal with vscan values

Message ID CAOFGe95z9y6b20G5SN1zpM0BQrek3VgvidbWEqwhRDZYn9MG_Q@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jason Ekstrand June 15, 2018, 6:43 a.m. UTC
Before we get too happy to merge things, I ran the CTS tests and there are
some failures...  I've attached a fixup patch that fixes three bugs I found:

 1) We weren't setting planeReorderPossible at all and we were using 0
instead of VK_FALSE (they're the same but we should use the enum) for
persistentContent
 2) We weren't advertising disconnected connectors via
GetPhysicalDeviceDisplayProperties but were returning them from
GetPhysicalDeviceDisplayPlaneProperties.
 3) We weren't setting result if the condition variable failed to
initialize (thanks GCC!)
​
There is one outstanding issue that the CTS is complaining about, namely
that you can't create modes.  It tests that mode creation fails for a mode
with a zero width, height, or refresh rate and that's all fine.  It then
tries to re-create one of the modes that we've returned to it in
GetDisplayModeProperties and assumes that it will work.  We should probably
at least make sure that works by walking the list and looking for a mode
that matches the requested one and returning it.  I don't think anything
actually requires us to return a unique pointer so it can be a search
instead of a create.

--Jason

Comments

Keith Packard June 19, 2018, 8:56 p.m. UTC | #1
Jason Ekstrand <jason@jlekstrand.net> writes:

>  1) We weren't setting planeReorderPossible at all and we were using 0
> instead of VK_FALSE (they're the same but we should use the enum) for
> persistentContent
>  2) We weren't advertising disconnected connectors via
> GetPhysicalDeviceDisplayProperties but were returning them from
> GetPhysicalDeviceDisplayPlaneProperties.
>  3) We weren't setting result if the condition variable failed to
> initialize (thanks GCC!)
> ​
> There is one outstanding issue that the CTS is complaining about, namely
> that you can't create modes.  It tests that mode creation fails for a mode
> with a zero width, height, or refresh rate and that's all fine.  It then
> tries to re-create one of the modes that we've returned to it in
> GetDisplayModeProperties and assumes that it will work.  We should probably
> at least make sure that works by walking the list and looking for a mode
> that matches the requested one and returning it.  I don't think anything
> actually requires us to return a unique pointer so it can be a search
> instead of a create.

And that seems to at least make CTS happy. I've merged your fixes into
the first patch, added support for vkCreateDisplayModeKHR, rebased to
master and pushed the results to my repository.

It looks like we're done here but I'll wait until I hear from you before
pushing to master in case you've got additional concerns.
Jason Ekstrand June 19, 2018, 9:16 p.m. UTC | #2
On Tue, Jun 19, 2018 at 1:56 PM, Keith Packard <keithp@keithp.com> wrote:

> Jason Ekstrand <jason@jlekstrand.net> writes:
>
> >  1) We weren't setting planeReorderPossible at all and we were using 0
> > instead of VK_FALSE (they're the same but we should use the enum) for
> > persistentContent
> >  2) We weren't advertising disconnected connectors via
> > GetPhysicalDeviceDisplayProperties but were returning them from
> > GetPhysicalDeviceDisplayPlaneProperties.
> >  3) We weren't setting result if the condition variable failed to
> > initialize (thanks GCC!)
> > ​
> > There is one outstanding issue that the CTS is complaining about, namely
> > that you can't create modes.  It tests that mode creation fails for a
> mode
> > with a zero width, height, or refresh rate and that's all fine.  It then
> > tries to re-create one of the modes that we've returned to it in
> > GetDisplayModeProperties and assumes that it will work.  We should
> probably
> > at least make sure that works by walking the list and looking for a mode
> > that matches the requested one and returning it.  I don't think anything
> > actually requires us to return a unique pointer so it can be a search
> > instead of a create.
>
> And that seems to at least make CTS happy. I've merged your fixes into
> the first patch, added support for vkCreateDisplayModeKHR, rebased to
> master and pushed the results to my repository.
>
> It looks like we're done here but I'll wait until I hear from you before
> pushing to master in case you've got additional concerns.
>

Looks good.  Passes the CTS.  Push it!
Keith Packard June 19, 2018, 9:33 p.m. UTC | #3
Jason Ekstrand <jason@jlekstrand.net> writes:

> Looks good.  Passes the CTS.  Push it!

All done. Now just two more series to go in this set :-)
diff mbox

Patch

From 4fbd63dc00a17f3ec8f71ec65a0b444316bac95f Mon Sep 17 00:00:00 2001
From: Jason Ekstrand <jason.ekstrand@intel.com>
Date: Thu, 14 Jun 2018 23:22:17 -0700
Subject: [PATCH] Fixups

---
 src/vulkan/wsi/wsi_common_display.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c
index e140e71c518..d1453368dfd 100644
--- a/src/vulkan/wsi/wsi_common_display.c
+++ b/src/vulkan/wsi/wsi_common_display.c
@@ -384,7 +384,8 @@  wsi_display_fill_in_display_properties(struct wsi_device *wsi_device,
       floor(properties->physicalResolution.height * MM_PER_PIXEL + 0.5);
 
    properties->supportedTransforms = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
-   properties->persistentContent = 0;
+   properties->planeReorderPossible = VK_FALSE;
+   properties->persistentContent = VK_FALSE;
 }
 
 /*
@@ -488,7 +489,7 @@  wsi_display_get_display_plane_supported_displays(
    int c = 0;
 
    wsi_for_each_connector(connector, wsi) {
-      if (c == plane_index) {
+      if (c == plane_index && connector->connected) {
          vk_outarray_append(&conn, display) {
             *display = wsi_display_connector_to_handle(connector);
          }
@@ -1387,8 +1388,10 @@  wsi_display_init_wsi(struct wsi_device *wsi_device,
       goto fail_mutex;
    }
 
-   if (!wsi_init_pthread_cond_monotonic(&wsi->wait_cond))
+   if (!wsi_init_pthread_cond_monotonic(&wsi->wait_cond)) {
+      result = VK_ERROR_OUT_OF_HOST_MEMORY;
       goto fail_cond;
+   }
 
    wsi->base.get_support = wsi_display_surface_get_support;
    wsi->base.get_capabilities = wsi_display_surface_get_capabilities;
-- 
2.17.1