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

[WPE] Fix DRM initialization in nxp-imx6qp-sdb board #23608

Conversation

psaavedra
Copy link
Contributor

@psaavedra psaavedra commented Jan 31, 2024

5a6315f

[WPE] Fix DRM initialization in nxp-imx6qp-sdb board
https://bugs.webkit.org/show_bug.cgi?id=268487

Reviewed by Carlos Garcia Campos.

This patch is generic but fixes the DRM initialization for NXP imx6qp
Sabre Development boards:

* Removes the check for the valid connector in the chooseConnector().
  The encoder Id can be zero if the connector is not currently bound
  to an encoder or if the encoder+crtc is already used by another
  connector.

* Modifies the chooseCrtcForConnector() logic. We implement a more
  robust mechanism by checking the encoder->possible_crtcs in case of
  no active crtc was found.

Credits to Jani Hautakangas <jani@igalia.com>.

Related-To: Igalia/cog#590
Related-To: #23654
Related-To: #23657

* Source/WebKit/WPEPlatform/wpe/drm/WPEDisplayDRM.cpp:
(chooseConnector):
(chooseCrtcForConnector):

Canonical link: https://commits.webkit.org/273898@main

6c5d0b2

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style   πŸ›  ios   πŸ›  mac   πŸ›  wpe   πŸ›  wincairo
  πŸ›  ios-sim   πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
  πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2   πŸ§ͺ api-mac   πŸ§ͺ api-wpe
  πŸ§ͺ ios-wk2-wpt   πŸ§ͺ mac-wk1   πŸ›  gtk
  πŸ§ͺ api-ios   πŸ§ͺ mac-wk2   πŸ§ͺ gtk-wk2
  πŸ›  tv   πŸ§ͺ mac-AS-debug-wk2   πŸ§ͺ api-gtk
  πŸ›  tv-sim   πŸ§ͺ mac-wk2-stress
  πŸ›  watch
βœ… πŸ›  πŸ§ͺ unsafe-merge   πŸ›  watch-sim

@psaavedra psaavedra requested review from zdobersek and a team as code owners January 31, 2024 19:43
@psaavedra psaavedra self-assigned this Jan 31, 2024
@psaavedra psaavedra added the WPE WebKit WebKit WPE component label Jan 31, 2024
@psaavedra psaavedra force-pushed the eng/WPE-Fix-DRM-initialization-in-nxp-imx6qp-sdb-board branch from 60c9146 to 01f4834 Compare January 31, 2024 20:07
@psaavedra psaavedra marked this pull request as draft February 1, 2024 09:32
@carlosgcampos
Copy link
Contributor

  • Simplifies checks for the valid connector in the chooseConnector():

    • It looks like the DRM_MODE_CONNECTOR_WRITEBACK is not required
      for rendering WPE in DRM mode.

Right, that's why we ignore writeback connectors.

  • The encoder Id can be zero.

Are you sure 0 is a valid drm object identifier?

@psaavedra
Copy link
Contributor Author

  • Simplifies checks for the valid connector in the chooseConnector():

    • It looks like the DRM_MODE_CONNECTOR_WRITEBACK is not required
      for rendering WPE in DRM mode.

Right, that's why we ignore writeback connectors.

  • The encoder Id can be zero.

Are you sure 0 is a valid drm object identifier?

0 is valid since we can be in the case explained here #23608 (comment) : he connector is not currently bound to an encoder or if the encoder+crtc is already used by another connector.

@psaavedra
Copy link
Contributor Author

psaavedra commented Feb 1, 2024

  • Simplifies checks for the valid connector in the chooseConnector():

    • It looks like the DRM_MODE_CONNECTOR_WRITEBACK is not required
      for rendering WPE in DRM mode.
      Right, that's why we ignore writeback connectors.

I see. But then, if all are DRM_MODE_CONNECTOR_WRITEBACK:ON then we are skipping all of them. What I think this is the case in my board.

UPDATE: to keep the check for the DRM_MODE_CONNECTOR_WRITEBACK is ok.

@psaavedra psaavedra force-pushed the eng/WPE-Fix-DRM-initialization-in-nxp-imx6qp-sdb-board branch from f2830a0 to aaf3552 Compare February 1, 2024 11:23
@webkit-early-warning-system
Copy link
Collaborator

Starting EWS tests for aaf3552. Live statuses available at the PR page, #23608

webkit-commit-queue pushed a commit to psaavedra/WebKit that referenced this pull request Feb 1, 2024
…ization

https://bugs.webkit.org/show_bug.cgi?id=268533

Reviewed by Carlos Garcia Campos.

This change removes the DPMS property check. The DPMS is a legacy
property for setting the power state of the connector. For atomic
drivers this is only provided for backwards compatibility with
existing drivers.

Related-To: WebKit#23608

* Source/WebKit/WPEPlatform/wpe/drm/WPEDRM.cpp:
(WPE::DRM::Connector::create):

Canonical link: https://commits.webkit.org/273895@main
webkit-commit-queue pushed a commit to psaavedra/WebKit that referenced this pull request Feb 1, 2024
…odesetting

https://bugs.webkit.org/show_bug.cgi?id=268535

Reviewed by Carlos Garcia Campos and Adrian Perez de Castro.

Fixes the findDevice() by ensuring the returning device has DRM
resources.

Related-To: WebKit#23608

* Source/WebKit/WPEPlatform/wpe/drm/WPEDisplayDRM.cpp:
(findDevice):

Canonical link: https://commits.webkit.org/273896@main
@psaavedra psaavedra marked this pull request as ready for review February 1, 2024 11:59
Source/WebKit/WPEPlatform/wpe/drm/WPEDisplayDRM.cpp Outdated Show resolved Hide resolved
Source/WebKit/WPEPlatform/wpe/drm/WPEDisplayDRM.cpp Outdated Show resolved Hide resolved
Source/WebKit/WPEPlatform/wpe/drm/WPEDisplayDRM.cpp Outdated Show resolved Hide resolved
@psaavedra psaavedra force-pushed the eng/WPE-Fix-DRM-initialization-in-nxp-imx6qp-sdb-board branch from aaf3552 to 3d07a0a Compare February 1, 2024 12:17
@psaavedra psaavedra force-pushed the eng/WPE-Fix-DRM-initialization-in-nxp-imx6qp-sdb-board branch from 3d07a0a to 6c5d0b2 Compare February 1, 2024 12:20
@psaavedra psaavedra added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 1, 2024
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WPE-Fix-DRM-initialization-in-nxp-imx6qp-sdb-board branch from 6c5d0b2 to 95ad529 Compare February 1, 2024 12:23
https://bugs.webkit.org/show_bug.cgi?id=268487

Reviewed by Carlos Garcia Campos.

This patch is generic but fixes the DRM initialization for NXP imx6qp
Sabre Development boards:

* Removes the check for the valid connector in the chooseConnector().
  The encoder Id can be zero if the connector is not currently bound
  to an encoder or if the encoder+crtc is already used by another
  connector.

* Modifies the chooseCrtcForConnector() logic. We implement a more
  robust mechanism by checking the encoder->possible_crtcs in case of
  no active crtc was found.

Credits to Jani Hautakangas <jani@igalia.com>.

Related-To: Igalia/cog#590
Related-To: WebKit#23654
Related-To: WebKit#23657

* Source/WebKit/WPEPlatform/wpe/drm/WPEDisplayDRM.cpp:
(chooseConnector):
(chooseCrtcForConnector):

Canonical link: https://commits.webkit.org/273898@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WPE-Fix-DRM-initialization-in-nxp-imx6qp-sdb-board branch from 95ad529 to 5a6315f Compare February 1, 2024 12:25
@webkit-commit-queue
Copy link
Collaborator

Committed 273898@main (5a6315f): https://commits.webkit.org/273898@main

Reviewed commits have been landed. Closing PR #23608 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 5a6315f into WebKit:main Feb 1, 2024
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WPE WebKit WebKit WPE component
Projects
None yet
4 participants