Skip to content

Commit 4cb0f93

Browse files
committed
update to r138, try to update the mesa to the latest version but failed
1 parent 67ebb79 commit 4cb0f93

160 files changed

Lines changed: 27152 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/content/common/gpu_pre_sandbox_hook_linux.cc b/content/common/gpu_pre_sandbox_hook_linux.cc
2+
index 97f7221cb1a56..519345b8a2202 100644
3+
--- a/content/common/gpu_pre_sandbox_hook_linux.cc
4+
+++ b/content/common/gpu_pre_sandbox_hook_linux.cc
5+
@@ -600,6 +600,7 @@ void LoadArmGpuLibraries() {
6+
7+
bool LoadAmdGpuLibraries() {
8+
// Preload the amdgpu-dependent libraries.
9+
+#if 0
10+
if (nullptr == dlopen("libglapi.so", dlopen_flag)) {
11+
LOG(ERROR) << "dlopen(libglapi.so) failed with error: " << dlerror();
12+
return false;
13+
@@ -613,6 +614,11 @@ bool LoadAmdGpuLibraries() {
14+
LOG(ERROR) << "dlopen(radeonsi_dri.so) failed with error: " << dlerror();
15+
return false;
16+
}
17+
+#endif
18+
+ if (nullptr == dlopen("libgallium_dri.so", dlopen_flag)) {
19+
+ LOG(ERROR) << "dlopen(libgallium_dri.so) failed with error: " << dlerror();
20+
+ return false;
21+
+ }
22+
return true;
23+
}
24+

make.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ USE="${USE} amd-common hevc_codec kvm_nested"
77
USE="${USE} scheduler_configuration_performance native_gpu_memory_buffers"
88

99
VIDEO_CARDS="radeon amdgpu radeonsi"
10+
11+
#EMERGE_DEFAULT_OPTS="--jobs=32 --load-average=32"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cros_pre_src_prepare_openapu() {
2+
if [ ${PV} == 9999 ]; then
3+
return
4+
fi
5+
eapply ${OPENFYDE_APU_BASHRC_FILESDIR}/001-fix-DRI-FORMAT.patch
6+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../minigbm/files/001-fix-DRI-FORMAT.patch

media-libs/mesa-amd/DIR_METADATA

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Metadata information for this directory.
2+
#
3+
# For more information on DIR_METADATA files, see:
4+
# https://source.chromium.org/chromium/infra/infra/+/HEAD:go/src/infra/tools/dirmd/README.md
5+
#
6+
# For the schema of this file, see Metadata message:
7+
# https://source.chromium.org/chromium/infra/infra/+/HEAD:go/src/infra/tools/dirmd/proto/dir_metadata.proto
8+
9+
buganizer {
10+
component_id: 885255 # ChromeOS > Platform > Graphics
11+
}
12+
team_email: "chromeos-gfx@google.com"
13+
14+
chromeos {
15+
cq {
16+
source_test_plans {
17+
test_plan_starlark_files {
18+
host: "chrome-internal.googlesource.com"
19+
project: "chromeos/config-internal"
20+
path: "test/plans/v2/ctpv1_compatible/borealis.star"
21+
}
22+
}
23+
}
24+
}

media-libs/mesa-amd/OWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include chromiumos/platform/graphics:/OWNERS.mesa_amd

media-libs/mesa-amd/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
### mesa-amd dev and uprev process
2+
3+
mesa-amd follows a traditional [cros_workon](https://chromium.googlesource.com/chromiumos/docs/+/HEAD/developer_guide.md#making-changes-to-packages-whose-source-code-is-checked-into-chromium-os-git-repositories) workflow where changes are made directly to src/third_party/mesa-amd. This is different from the [mesa](https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/HEAD/media-libs/mesa/mesa-9999.ebuild) project, which follows the CROS_WORKON_MANUAL_UPREV workflow.
4+
5+
Working in mesa-amd takes an "upstream first" philosophy, and downstream changes represent technical debt and should be avoided. Commit messages for downstream changes in mesa-amd are [prefixed in a similar fashion](https://chromium.googlesource.com/chromiumos/docs/+/HEAD/kernel_development.md#commit-messages-summary-lines-chromium_upstream_fromlist_backport) as changes in the kernel and elsewhere in Chrome OS.
6+
7+
Refer to the [upstream documentation](https://docs.mesa3d.org/releasing.html#release-schedule) for details about upstream mesa's release schedule. To summarize, approximately every three months is a [feature release](https://docs.mesa3d.org/releasing.html#feature-releases), followed by [stable releases](https://docs.mesa3d.org/releasing.html#stable-releases) approximately every two weeks.
8+
9+
mesa-amd generally tracks upstream feature release branches, with possibly a small number of downstream changes applied on top.
10+
11+
Tags and branches from upstream are automatically synced to the chromiumos mesa mirror. Tags and branch names are synced under upstream/... (for example, [upstream/mesa-21.2.1](https://chromium.googlesource.com/chromiumos/third_party/mesa/+/refs/tags/upstream/mesa-21.2.1) and [upstream/21.1](https://chromium.googlesource.com/chromiumos/third_party/mesa/+/refs/heads/upstream/21.2)).
12+
13+
#### Uprev process
14+
15+
When uprevving to a new release branch, follow the below process to reset the tree to its upstream state.
16+
```
17+
# Create a merge commit that resolves all merge conflicts such that all changes are discarded in favor of those in the new upstream branch
18+
git merge upstream/mesa-21.2.1 -X theirs --no-commit
19+
git read-tree upstream/mesa-21.2.1
20+
# Restore this file to ensure that presubmit checks survive the uprev.
21+
git add PRESUBMIT.cfg
22+
# Create an appropriate commit message, and add BUG= and TEST= tags appropriately.
23+
git commit -m "CHROMIUM: Reset tree to upstream/mesa-21.2.1"
24+
# Clean up the index
25+
git clean -f
26+
git reset --hard HEAD
27+
# Confirm that the state of the tree is identical to the upstream state, modulo the PRESUMBIT.cfg that was added.
28+
git diff-tree --no-commit-id --name-status upstream/mesa-21.2.1 HEAD
29+
```
30+
31+
Use `git log --first-parent --pretty='%h %s'` to see the list of changes since the last time the tree was reset, and assess whether downstream patches can be dropped, or if they need to be cherry-picked again. You may need to cherry-pick some long-lived dowstream changes (i.e. CHROMIUM: patches). When you cherry-pick such a patch, edit the commit message to strip old tags such as Change-Id, Reviewed-By, etc., and update the BUG= to reference the bug tracking the uprev effort.
32+
33+
Subsequent stable releases from upstream can be applied by using `git merge` and uploading the merge commit to Gerrit.
34+
35+
36+
#### Downstream changes
37+
The preferred flow to get changes into mesa-amd is to:
38+
1. Send a change upstream for review
39+
2. Get it merged upstream
40+
3. Ensure it is included in the next upstream stable release
41+
4. `git merge` the next stable release containing the change.
42+
43+
There may be cases where we cannot do this for a particular change, or a change is needed more urgently than this process allows. In such cases, we may upload changes to Gerrit with an appropriate prefix. These prefixes are:
44+
- UPSTREAM: Indicates that the patch has landed in upstream mesa
45+
- This is appropriate when the UPSTREAM change will never land in a subsequent stable release, or we need to land it in Chrome OS more expediently than the upstream stable release process allows for.
46+
- Use `git cherry-pick -x` to ensure that the commit message contains the commit hash of the UPSTREAM commit
47+
- BACKPORT: Same as upstream, but there are conflicts that needed to be addressed
48+
- Describe the conflicts and their resolution in the commit message
49+
- FROMLIST: The patch is under review in an upstream merge request
50+
- These should not be merged except for P0/P1 issues. It's strongly preferred to wait for the completion of the review upstream, and then apply the change as UPSTREAM
51+
- Owner+Reviewer of this change is responsible to follow up on the upstream review process and ensure that it gets merged in a timely manner.
52+
- Include a link to the merge-request in the commit message
53+
- CHROMIUM: The patch cannot be upstreamed
54+
- There must be strong justification for why an upstreamable solution is not viable.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
diff --git a/meson.build b/meson.build
2+
index d5dbe95075c..f8f418d2ee0 100644
3+
--- a/meson.build
4+
+++ b/meson.build
5+
@@ -895,7 +895,6 @@ if with_platform_android
6+
dep_android = [
7+
dependency('cutils'),
8+
dependency('hardware'),
9+
- dependency('log'),
10+
dependency('sync'),
11+
]
12+
if with_libbacktrace
13+
diff --git a/src/gallium/targets/dril/dril_target.c b/src/gallium/targets/dril/dril_target.c
14+
index 8b40e3627fb..70c663c3357 100644
15+
--- a/src/gallium/targets/dril/dril_target.c
16+
+++ b/src/gallium/targets/dril/dril_target.c
17+
@@ -361,6 +361,7 @@ init_dri2_configs(int fd)
18+
EGLBoolean (*peglGetConfigAttrib)(EGLDisplay, EGLConfig, EGLint, EGLint *) = peglGetProcAddress("eglGetConfigAttrib");
19+
const char *(*peglQueryString)(EGLDisplay, EGLint) = peglGetProcAddress("eglQueryString");
20+
21+
+#if 0
22+
struct gbm_device *gbm = NULL;
23+
if (fd != -1) {
24+
/* try opening GBM for hardware driver info */
25+
@@ -368,8 +369,9 @@ init_dri2_configs(int fd)
26+
if (!gbm)
27+
goto out;
28+
}
29+
+#endif
30+
31+
- EGLDisplay dpy = peglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, gbm ? gbm : EGL_DEFAULT_DISPLAY, NULL);
32+
+ EGLDisplay dpy = peglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, /*gbm ? gbm :*/ EGL_DEFAULT_DISPLAY, NULL);
33+
if (!dpy)
34+
goto out_gbm;
35+
int maj, min;
36+
@@ -436,8 +438,10 @@ out_egl:
37+
peglTerminate(dpy);
38+
39+
out_gbm:
40+
+#if 0
41+
if (gbm)
42+
gbm_device_destroy(gbm);
43+
+#endif
44+
out:
45+
dlclose(egl);
46+
if (c)
47+
@@ -537,6 +541,7 @@ const __DRIdri2Extension drilDRI2Extension = {
48+
49+
/* these are the methods used by the xserver */
50+
.createNewScreen = dril2CreateNewScreen,
51+
+ .createNewScreen2 = drilCreateNewScreen,
52+
.createNewDrawable = drilCreateNewDrawable,
53+
.createNewContext = drilCreateNewContext,
54+
.createContextAttribs = drilCreateContextAttribs,
55+
diff --git a/src/meson.build b/src/meson.build
56+
index 61d7d1d40fa..c9d2554fd4c 100644
57+
--- a/src/meson.build
58+
+++ b/src/meson.build
59+
@@ -138,10 +138,8 @@ endif
60+
if with_egl
61+
subdir('egl')
62+
endif
63+
-if with_gallium and with_gbm
64+
- if with_glx == 'dri' or with_platform_x11 or with_platform_xcb
65+
+if with_gallium
66+
subdir('gallium/targets/dril')
67+
- endif
68+
endif
69+
70+
if with_gbm and with_dri2
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
#
3+
# Copyright 2020 The ChromiumOS Authors
4+
# Use of this source code is governed by a BSD-style license that can be
5+
# found in the LICENSE file.
6+
#
7+
# This script is given one argument: the base of the source directory of
8+
# the package, and it prints a string on stdout with the numerical version
9+
# number for said repo.
10+
11+
exec sed -e 's/devel/pre/g' -e 's/-/_/g' "$1/VERSION"

media-libs/mesa-amd/files/drirc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<driconf>
2+
<device driver="radeonsi">
3+
<application name="Default">
4+
<!-- Disabled protected content check for secure playback -->
5+
<option name="disable_protected_content_check" value="true"/>
6+
</application>
7+
</device>
8+
</driconf>
9+

0 commit comments

Comments
 (0)