-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge Ozone prototype commits into main #4727
base: main
Are you sure you want to change the base?
Conversation
…outube#4654) This reverts commit cc55e87.
…ube#4688) Move ownership of SbWindow to PlatformWindowStarboard, allowing us to get the proper initialization size and assign it as the platform window in the platform window delegate. b/388348504
Swap to using Angle instead of native GLES to avoid devel/debug builds crashing. b/390499263
Mappings from kSbKeyFoo to ui::DomCode::Bar .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only thing I see here that we should really avoid (and looks avoidable considering it's feature-gated)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few hacks left in there. Some might be removable with the move to Angle, but do we want to merge the others over?
Also in a couple spots we should put TODO comments to make sure we revisit those sections.
if (blocklisted_features.count(GPU_FEATURE_TYPE_ACCELERATED_GL)) | ||
return kGpuFeatureStatusBlocklisted; | ||
// TODO(cobalt, b/371272304): Re-enable | ||
// if (blocklisted_features.count(GPU_FEATURE_TYPE_ACCELERATED_GL)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was one of the hacks we didn't really want to pull in. We might not need this anymore with the switch over to using Angle, but we'll need to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change it to #if !BUILDFLAG(IS_STARBOARD) instead of commenting it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's please remove it entirely instead of using a buildflag—it's already gated by feature flags, we should just use those if we still need to (which we should be able to do from cobalt-owned code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dug into this today. I couldn't find a flag to target GPU_FEATURE_TYPE_ACCELERATED_GL specifically, but one might exist. There is a switch to ignore the gpu blocklist but that caused a separate crash (likely we do want the other features to remain blocked). In that same file there's a switch for blocklist test groups that enable/disable different sets of features. There may be a specific group we could set but I didn't find the test group definitions.
While backtracking from that feature setting I found that the blocklist is created here using default values. The default values are values for software rendering and from a generated file, out/linux-x64x11_devel/gen/gpu/config/software_rendering_list_autogen.cc, which is based on a template file. So maybe we can configure it there, but it seems to target devices very specifically and I don't know if we can apply a blanket rule of if_starboard -> enable accelerated gl/disable software compositing.
I did find that the only place it seems to matter for the crash is in the gpu_init. Setting the feature to enabled immediately after that compute call (with the line gpu_feature_info_.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] = kGpuFeatureStatusEnabled;
) stopped the crash for me. But there are also a lot of calls to that same function in that file gated behind a whole host of #if directives, so there may be some build where we would hit a different one than that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC the Chrome GPU/Graphics team always had little bandwidth to support the multitude of GPU + driver combinations on Linux so in general I'd expect Linux == all GPU features disabled. With that I'd +1 the blanket rule approach (if_starboard -> enable GPU accelerated stuff). Hopefully we'll never have to maintain our own blocklist! :)
return true; | ||
} | ||
// TODO(cobalt, b/371272304): Re-enable | ||
// if (gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] != |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here for hacks. In this case, swiftshader should ideally be fully disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same:
#if !BUILDFLAG(IS_STARBOARD)
@@ -43,7 +43,8 @@ bool GetOnlineStatus(bool* is_online_ptr, int netlink_fd) { | |||
sa.nl_groups = RTMGRP_IPV4_IFADDR; | |||
sa.nl_pid = getpid(); | |||
int bind_result = bind(netlink_fd, (struct sockaddr*)&sa, sizeof(sa)); | |||
SB_DCHECK(bind_result == 0); | |||
// TODO(cobalt, b/371272304): Re-enable | |||
// SB_DCHECK(bind_result == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one we really want to solve since it's in starboard, but this is also a hack. I'm not sure what the solution is here, we might want to work with @jellefoks to figure out why this check fails when using Ozone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get it in for now.
sources = [ | ||
"test/platform_window_starboard_unittest.cc", | ||
"test/starboard_test_helper.cc", | ||
"test/starboard_test_helper.h", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will change with an incoming change of mine, but I can just merge that straight to main so don't let it block merging this.
if (!surface_factory_) { | ||
surface_factory_ = std::make_unique<SurfaceFactoryStarboard>(); | ||
} | ||
// Not thread safe. This is just for prototyping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some changes came in for events but this comment remained. Is it still true that this isn't thread safe?
{kSbKeyTab, ui::DomCode::TAB}, | ||
{kSbKeyEscape, ui::DomCode::ESCAPE}, | ||
}); | ||
// Hack: replace this when implementing event handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a TODO here instead of this old comment? We want to make sure we have an easy way to find things like this. Also @y4vor do we still need the task runner with the new approach or will we be dropping this at some point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, please add TODO comment
@@ -65,10 +65,12 @@ PlatformScreenStarboard::GetAcceleratedWidgetAtScreenPoint( | |||
|
|||
void PlatformScreenStarboard::AddObserver(display::DisplayObserver* observer) { | |||
// TODO(b/371272304): Add Observer to display::DisplayList. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking, but I thought I removed these TODOs when I actually added and removed the observers to the display list? Once this is on main I can go in and remove these comments again.
Had weird merge conflicts in #4726 so cherry-picked relevant changes instead.
b/391414243