Skip to content

Port Samsung display driver#19

Merged
stakach merged 95 commits into
masterfrom
samsung_port
Nov 4, 2020
Merged

Port Samsung display driver#19
stakach merged 95 commits into
masterfrom
samsung_port

Conversation

@pkheav
Copy link
Copy Markdown
Contributor

@pkheav pkheav commented Jun 22, 2020

No description provided.

@pkheav pkheav changed the title : Port Samsung display driver Jun 22, 2020
@pkheav pkheav requested a review from kimburgess June 22, 2020 08:35
Copy link
Copy Markdown
Contributor

@kimburgess kimburgess left a comment

Choose a reason for hiding this comment

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

Really nice start! Take a dig through some of these comments, then hit me up with anything that doesn't make sense.

We'll likely go through a few rounds of this. Please don't take this as my being overly critical, this is just a good opportunity to discuss and start building a common coding style for these drivers under crystal.

The main things to remember when porting across is that clean, highly solid implementations > feature parity. They definitely will not be a line-for-line port and these re-writes are a good opportunity to ensure we create a nice, maintainable code base.

Comment thread drivers/samsung/displays/md_series.cr Outdated
Comment thread drivers/samsung/displays/md_series.cr Outdated
Comment thread drivers/samsung/displays/md_series.cr Outdated
Comment thread drivers/samsung/displays/md_series.cr Outdated
Comment thread drivers/samsung/displays/md_series.cr Outdated
Comment thread drivers/samsung/displays/md_series.cr Outdated
Comment thread drivers/samsung/displays/md_series.cr Outdated
Comment thread drivers/samsung/displays/md_series.cr Outdated
Comment thread drivers/samsung/displays/md_series.cr Outdated
Comment thread drivers/samsung/displays/md_series.cr Outdated
Copy link
Copy Markdown
Contributor

@kimburgess kimburgess left a comment

Choose a reason for hiding this comment

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

Looking nice! A couple of minor things to still neaten up.

For the specs: rebase this branch from the current master. This will pull in the latest dependencies and restore compatibility with the current state of the driver framework and crystal compiler. You’ll need to force push that back here, but no issues doing that while this is pre-merge.

Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
@caspiano caspiano self-requested a review August 7, 2020 12:31
caspiano
caspiano previously approved these changes Aug 7, 2020
@jeremy-west jeremy-west linked an issue Aug 27, 2020 that may be closed by this pull request
@pkheav pkheav mentioned this pull request Aug 28, 2020
@pkheav pkheav requested a review from kimburgess September 29, 2020 11:48
@pkheav
Copy link
Copy Markdown
Contributor Author

pkheav commented Sep 29, 2020

Hey @kimburgess , just re requested your review. I've addressed all your changes except for this one #19 (comment)

@jeremyw24 jeremyw24 assigned pkheav and kimburgess and unassigned pkheav Oct 8, 2020
Copy link
Copy Markdown
Contributor

@kimburgess kimburgess left a comment

Choose a reason for hiding this comment

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

Only a couple of super small point for discussion here. Let's sort them, check all the spec pass then gtg!

Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
Comment thread drivers/samsung/displays/mdc_protocol.cr Outdated
@pkheav pkheav requested a review from kimburgess October 12, 2020 12:40
Copy link
Copy Markdown
Contributor

@kimburgess kimburgess left a comment

Choose a reason for hiding this comment

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

Looking good - confirming specs are green here.

Before me merge as one last thing can you add some specs that cover power and switch_to.

@pkheav pkheav requested a review from kimburgess October 13, 2020 11:04
Copy link
Copy Markdown
Contributor

@kimburgess kimburgess left a comment

Choose a reason for hiding this comment

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

Nice one. Things should work in this state.

Before merge I'm opening up a discussion here with @stakach and @caspiano. There's some behaviour in this driver that's a carry over from the old one: both the power state and input are forced to specific targets based on the last applied state. If these change from an external source, the target states will be reapplied when this is detected.

IMHO this is something that we should make a rule to disallow (or at least strongly discourage) at the device driver level. Doing so will keep the drivers simpler so they purely provide control and an accurate view of the current state. These other behaviours can then be abstracted into logic drivers and applied where needed. It also removes some of potential failure modes of having duplicate module instances, other systems, or humans interacting with a physical device competing against each other. Thoughts?

@stakach stakach merged commit 3e9d95b into master Nov 4, 2020
@stakach stakach deleted the samsung_port branch November 4, 2020 06:32
@kimburgess
Copy link
Copy Markdown
Contributor

kimburgess commented Nov 4, 2020

@stakach bump on the query above.

@stakach
Copy link
Copy Markdown
Member

stakach commented Nov 4, 2020

The way it works in the ruby version, I believe, is that the state is forced if selected by the driver.
Once in a stable state then it no longer forces the input and external changes are OK

The reason for doing this is that the display ignores commands, or is busy when powering on etc
and should go to the requested state as soon as it can

So I think the behaviour is desirable and generally external changes won't be overridden

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.

Samsung LCD

4 participants