Skip to content

Motorola display hack#128

Open
Michal-Szczepaniak wants to merge 1 commit intosailfishos:masterfrom
VerdandiTeam:master
Open

Motorola display hack#128
Michal-Szczepaniak wants to merge 1 commit intosailfishos:masterfrom
VerdandiTeam:master

Conversation

@Michal-Szczepaniak
Copy link
Copy Markdown

In motorola moto g2 to get display working, we had to first run surfaceflinger to "initialize" the display. This hack originally done by @guhl fixes that via minisf service and it would be nice to get it merged

ifeq ($(strip $(BOARD_USE_MOTO_SF)), true)
USE_MOTO_SF = 1
else
USE_MOTO_SF = 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Random observation: looks like this USE_MOTO_SF variable is not used for anything

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oh wait i see what you mean, yeah you're right

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also there's no need for this check. Please check the MTK hack that I added for Audiopolicy.

You can do:

ifeq ($(FOO),1)
LOCAL_CPP_FLAGS=-DFOO
endif

Please change.

Copy link
Copy Markdown
Contributor

@Thaodan Thaodan left a comment

Choose a reason for hiding this comment

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

Please add the comment that explains the need for the change to the commit message, not just to the PR comment.

Further you should follow the existing conventions for hacks/workarounds
the variables should be called _<descriptive_name_of_hack> e.g. in this case SURFACEFLINGER_MOTO_INITIALIZE_DISPLAY.

You can also add the description to Android.mk so it can be understood when building
droidmedia without checking git first.

The hack should be also included in the spec file just copy the section for the mtk hack and rename it for your hack.
By doing so they hack will be off by default but can be enabled if so requested.

For further see my comments.


LOCAL_CLANG := true

LOCAL_C_INCLUDES := frameworks/native/services/surfaceflinger
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The LOCAL_C_INCLUDES modified should be inside the section specific to the hack.

#ifdef USE_MOTO_SF
ProcessState::self()->setThreadPoolMaxThreadCount(4);
ALOGI("MOTO_SF SurfaceFlinger: start the thread pool");
// start the thread pool
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think these should be ALOGD?

ifeq ($(strip $(BOARD_USE_MOTO_SF)), true)
USE_MOTO_SF = 1
else
USE_MOTO_SF = 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also there's no need for this check. Please check the MTK hack that I added for Audiopolicy.

You can do:

ifeq ($(FOO),1)
LOCAL_CPP_FLAGS=-DFOO
endif

Please change.

# build minisfservice executable
include $(CLEAR_VARS)

LOCAL_CLANG := true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why was this required? It shouldn't be needed.

include $(BUILD_EXECUTABLE)

###############################################################
# build minisfservice executable
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No need to add comments here, limit your change to stay on topic.

@Michal-Szczepaniak
Copy link
Copy Markdown
Author

Will do will do

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.

3 participants