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

Android bp #1856

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Android bp #1856

wants to merge 2 commits into from

Conversation

JeevakaPrabu
Copy link

No description provided.

Copy link

@theandi666 theandi666 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@andrescj-chromium andrescj-chromium left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me.

@@ -0,0 +1,2265 @@
package {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Do you need a copyright notice?

Copy link
Author

Choose a reason for hiding this comment

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

Addressed

"-Wno-parentheses",
"-Wno-delete-incomplete",
"-Wno-overloaded-virtual",
"-std=c++14",
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that this is in media_driver/cmake/linux/media_compile_flags_linux.cmake but not in media_softlet/cmake/linux/media_compile_flags_linux.cmake. Does this matter?

Copy link
Author

Choose a reason for hiding this comment

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

no issues seen

Android.bp Outdated
"-Wno-delete-incomplete",
"-Wno-overloaded-virtual",
"-std=c++14",
"-m64",
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect -m64 to be added by Soong. See this.

Copy link
Author

Choose a reason for hiding this comment

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

Addressed

Android.bp Outdated
"-m64",
"-DNO_RTTI",
"-DNO_EXCEPTION_HANDLING",
"-Wno-ignored-optimization-argument",
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider removing -Wno-ignored-optimization-argument and -finline-limit=100 because:

  • According to media_driver/cmake/linux/media_compile_flags_linux.cmake and media_softlet/cmake/linux/media_compile_flags_linux.cmake, -finline-limit=100 is removed when using clang, and I'm pretty sure clang is the primary compiler for AOSP.
  • If -finline-limit=100 is removed, it looks like things build without -Wno-ignored-optimization-argument.

Copy link
Author

Choose a reason for hiding this comment

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

Addressed

"-DIGFX_XEHP_SDV_SUPPORTED",
"-DIGFX_XE_HPG_CMFCPATCH_SUPPORTED",
"-DIGFX_XE_HPG_SUPPORTED",
"-DMEDIA_VERSION=\"24.3.4\"",
Copy link
Contributor

Choose a reason for hiding this comment

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

How can we ensure MEDIA_VERSION and MEDIA_VERSION_DETAILS don't become stale?

For example, currently, CMakeLists.txt contains 24.4.0.

Additionally, MEDIA_VERSION_DETAILS is obtained dynamically using git rev-parse --short HEAD.

Copy link
Author

Choose a reason for hiding this comment

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

Android.bp can be generated now by running python3 Tools/MediaDriverTools/Android/GenerateAndroidBp.py. Pre-requisite is libva and gmmlib are compiled and installed in the build machine.

When GenerateAndroidBp.py script is used, Version and version_details gets generated instead of hardcoding.

"-DISTDLIB_UMD",
"-DVPHAL",
"-D__CT__",
"-fno-strict-aliasing",
Copy link
Contributor

@andrescj-chromium andrescj-chromium Oct 10, 2024

Choose a reason for hiding this comment

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

-fno-strict-aliasing is globally added, consider removing it from here.

Copy link
Author

Choose a reason for hiding this comment

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

Addressed

"-DVPHAL",
"-D__CT__",
"-fno-strict-aliasing",
"-D_FORTIFY_SOURCE=2",
Copy link
Contributor

Choose a reason for hiding this comment

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

You get -D_FORTIFY_SOURCE=2 for free as well.

Copy link
Author

Choose a reason for hiding this comment

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

Addressed

"-D__CT__",
"-fno-strict-aliasing",
"-D_FORTIFY_SOURCE=2",
],
Copy link
Contributor

Choose a reason for hiding this comment

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

I happened to notice that the cmrt CMakeLists.txt adds the -fstack-protector-all option. Consider adding it here as well.

Note: it looks like Soong adds -fstack-protector-strong automatically, but if I understand correctly, it offers less protection than -fstack-protector-all.

Copy link
Author

Choose a reason for hiding this comment

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

Addressed

],

cflags: [
"-Wno-error",
Copy link
Contributor

Choose a reason for hiding this comment

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

Reconsider the -W flags here. I tried the following that seems more strict and it still builds:

        "-Werror",
        "-Wno-non-virtual-dtor",
        "-Wno-implicit-fallthrough",
        "-Wno-reorder",

Copy link
Author

Choose a reason for hiding this comment

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

Addressed

@@ -40,7 +40,7 @@
#include <sys/types.h>
#include <sys/sem.h>
#include <sys/mman.h>
#include "mos_compat.h" // libc variative definitions: backtrace
//#include "mos_compat.h" // libc variative definitions: backtrace
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean to just remove this line?

Copy link
Author

Choose a reason for hiding this comment

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

Removed the line

* Fixed some compilation issues
* Update GenerateAndroidMk.py fix compile issue and
update tpl for cmrt and media_driver.
* Add 'media_add_curr_to_include_path()' to media_srcs.cmake

Tracked-On: OAM-117146
Signed-off-by: zhangyichix <[email protected]>
Signed-off-by: zhepeng.xu <[email protected]>
Test: make iHD_drv_video for x86_64

Change-Id: I9582630dc52b0780c1a63ab8ead63a1823186445
Signed-off-by: JeevakaPrabu <[email protected]>
Copy link
Contributor

@XinfengZhang XinfengZhang left a comment

Choose a reason for hiding this comment

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

I tried python3 Tools/MediaDriverTools/Android/GenerateAndroidBp.py
it generate
./gmmlib/Android.bp
./media-driver/cmrtlib/Android.bp
./media-driver/Android.bp
from feature wise, it do generate the Android.bp . it works.
but from my personal perspective:

  1. I am expecting a better GenerateAndroidBp.py , because from the sequence description here (https://github.com/intel/media-driver/blob/master/Tools/MediaDriverTools/Android/GenerateAndroidMk.py#L25-L30), this script run cmake firstly, then search file and dependencies from the Makefile. so, cmake system and Makefile works, in theory, this script should works without the changes in cmake file , such as "adding media_add_curr_to_include_path". we should not keep it scalable for future platform.
  2. if there are already such script as above, we could remove Android.bp in the top folder. anyone who has such requirement , could generate it by himself. maybe we could add a BKM in the wiki.

if 1 is not doable now. lets keep current solution as a out-of-tree patch, or keep it by down stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants