Skip to content
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

Add Android.bp for libva 2.22 #835

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
// Copyright (c) 2017-2023 Intel Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

package {
default_applicable_licenses: ["external_intel_libva_license"],
}

license {
name: "external_intel_libva_license",
visibility: [":__subpackages__"],
license_text: [
"COPYING",
],
}

sh_binary_host {
name: "libva_gen_version_script",
src: "build/gen_version.sh",
}

genrule {
name: "libva_gen_version",
srcs: [
"configure.ac",
"va/va_version.h.in",
],
tools: [
"libva_gen_version_script",
],
out: ["va/va_version.h"],
cmd: "$(location libva_gen_version_script) " +
"$$(dirname $(location configure.ac)) " +
"$(location va/va_version.h.in) > $(out)",
}

cc_library_headers {
name: "libva_headers",

export_include_dirs: [
".",
"va",
JeevakaPrabu marked this conversation as resolved.
Show resolved Hide resolved
"va/drm"
],

generated_headers: [
"libva_gen_version",
],
export_generated_headers: [
"libva_gen_version",
],

vendor: true,
enabled: false,
arch: {
x86_64: {
enabled: true,
},
},
}

cc_library_shared {
name: "libva",

shared_libs: [
"libdl",
"libdrm",
"libcutils",
"liblog",
],

local_include_dirs: [
"va"
],

generated_headers: [
"libva_gen_version",
],
export_generated_headers: [
"libva_gen_version",
],

header_libs: [
"liblog_headers",
],

srcs: [
"va/va.c",
"va/va_trace.c",
"va/va_str.c",
"va/drm/va_drm.c",
"va/drm/va_drm_auth.c",
"va/drm/va_drm_utils.c",
],

cflags: [
JeevakaPrabu marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions/comments to maybe simplify these flags:

  • "-D_FILE_OFFSET_BITS=64": isn't this implied by the fact that this module is only enabled on x86_64? According to this: "On 64 bit systems this macro has no effect since the *64 functions are identical to the normal functions."
  • -Wall: this can be removed because it's globally enabled. See this.
  • -O2: this is also globally enabled. See this.
  • -fPIC: the fact that this is a shared library module should imply position-independent code. See also this.
  • -DANDROID: this can be removed because it's globally enabled. See this.

Additionally, you had -Werror before. Consider adding that back.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommended change done

"-Werror",
"-Winvalid-pch",
"-DSYSCONFDIR=\"/vendor/etc\"",
"-DLOG_TAG=\"libva\"",
],

arch: {
x86_64: {
cflags: ["-DVA_DRIVERS_PATH=\"/vendor/lib64\""],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be as follows to avoid changing behavior from Android.mk:

"-DVA_DRIVERS_PATH=\"/vendor/lib64/dri\""

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Driver path is /vendor/lib64/. No need to change to /vendor/lib64/dri

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linux driver location is /lib/x86_64-linux-gnu/dri/
so , it is different, right?

enabled: true,
},
},

vendor: true,
enabled: false,
}
JeevakaPrabu marked this conversation as resolved.
Show resolved Hide resolved

cc_library_shared {
name: "libva-android",

shared_libs: [
"libva",
"libdrm",
"liblog",
],

local_include_dirs: [
"va",
"va/drm",
],

srcs: [
"va/android/va_android.cpp",
"va/drm/va_drm_utils.c",
],

cflags: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as above about the flags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"-Werror",
"-Winvalid-pch",
"-DLOG_TAG=\"libva-android\"",
],
JeevakaPrabu marked this conversation as resolved.
Show resolved Hide resolved

vendor: true,
enabled: false,
arch: {
x86_64: {
enabled: true,
},
},
}
4 changes: 0 additions & 4 deletions Android.mk

This file was deleted.

102 changes: 0 additions & 102 deletions va/Android.mk

This file was deleted.