Use SIZE_HINTS property for cursor buffer size instead of probing [chromium/src : main]

4 views
Skip to first unread message

Jiahe Zhang (Gerrit)

unread,
Jul 10, 2024, 4:25:02 AM7/10/24
to Jianhui J Dai, AyeAye, ozone-...@chromium.org

Jiahe Zhang voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
Gerrit-Change-Number: 5587916
Gerrit-PatchSet: 2
Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Comment-Date: Wed, 10 Jul 2024 08:24:53 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Jiahe Zhang (Gerrit)

unread,
Jul 11, 2024, 4:21:47 AM7/11/24
to Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
Attention needed from Peter McNeeley

Jiahe Zhang added 2 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Jiahe Zhang . resolved

Hi Peter, the SIZE_HINTS kernel patches have been backported to several branches (5.4, 6.1, 6.6). So I update the probing part to use SIZE_HINTS instead. PTAL.

File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
Line 47, Patchset 4 (Latest): // TODO(jiahe.zhang): Remove this once libdrm is updated.
Jiahe Zhang . unresolved

The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

Open in Gerrit

Related details

Attention is currently required from:
  • Peter McNeeley
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 4
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Jul 2024 08:21:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Peter McNeeley (Gerrit)

    unread,
    Jul 11, 2024, 10:14:32 AM7/11/24
    to Jiahe Zhang, Sean Paul, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang and Sean Paul

    Peter McNeeley added 3 comments

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 245, Patchset 4 (Latest): base::flat_map<std::string, std::vector<std::unique_ptr<DrmDumbBuffer>>>
    Peter McNeeley . unresolved

    We should really avoid using string. We should map to our types.

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 615, Patchset 4 (Latest): plane->CanUseForCrtcId(crtc_controllers_[0]->crtc())) {
    Peter McNeeley . unresolved

    This is for 0? This this going to matter? What about the other controllers

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 47, Patchset 4 (Latest): // TODO(jiahe.zhang): Remove this once libdrm is updated.
    Jiahe Zhang . unresolved

    The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

    Peter McNeeley

    @sean...@chromium.org Might know the status of things here.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jiahe Zhang
    • Sean Paul
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 4
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Attention: Sean Paul <sean...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Jul 2024 14:14:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Jiahe Zhang <jiahe...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jiahe Zhang (Gerrit)

    unread,
    Jul 15, 2024, 5:53:08 AM7/15/24
    to Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Peter McNeeley and Sean Paul

    Jiahe Zhang voted and added 3 comments

    Votes added by Jiahe Zhang

    Commit-Queue+1

    3 comments

    Patchset-level comments
    File-level comment, Patchset 5 (Latest):
    Jiahe Zhang . resolved

    Thanks for the review. Addressed the comments. PTAL.

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 245, Patchset 4: base::flat_map<std::string, std::vector<std::unique_ptr<DrmDumbBuffer>>>
    Peter McNeeley . unresolved

    We should really avoid using string. We should map to our types.

    Jiahe Zhang

    Done.

    Note:
    Directly using `base::flat_map<gfx::Size, ...>` here results in the following compile error, so `gfx::Rect` is used instead (or we will need to add `operator<` to `gfx::Size`.
    ```
    ../../base/containers/flat_map.h:283:31: error: no matching function for call to object of type 'key_compare' (aka 'std::less<void>')
    283 | if (found == tree::end() || tree::key_comp()(key, found->first))
    | ^~~~~~~~~~~~~~~~
    ../../ui/ozone/platform/drm/gpu/hardware_display_controller.cc:551:25: note: in instantiation of member function 'base::flat_map<gfx::Size, std::vector<std::unique_ptr<ui::DrmDumbBuffer>>>::operator[]' requested here
    551 | cursor_buffer_map_[size].push_back(

    ```

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 615, Patchset 4: plane->CanUseForCrtcId(crtc_controllers_[0]->crtc())) {
    Peter McNeeley . resolved

    This is for 0? This this going to matter? What about the other controllers

    Jiahe Zhang

    Done. We don't actually need the crtc check here.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Peter McNeeley
    • Sean Paul
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 5
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Attention: Sean Paul <sean...@chromium.org>
    Gerrit-Comment-Date: Mon, 15 Jul 2024 09:53:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Peter McNeeley <peterm...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Peter McNeeley (Gerrit)

    unread,
    Jul 15, 2024, 10:30:39 AM7/15/24
    to Jiahe Zhang, Sean Paul, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang and Sean Paul

    Peter McNeeley added 3 comments

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 245, Patchset 4: base::flat_map<std::string, std::vector<std::unique_ptr<DrmDumbBuffer>>>
    Peter McNeeley . unresolved

    We should really avoid using string. We should map to our types.

    Jiahe Zhang

    Done.

    Note:
    Directly using `base::flat_map<gfx::Size, ...>` here results in the following compile error, so `gfx::Rect` is used instead (or we will need to add `operator<` to `gfx::Size`.
    ```
    ../../base/containers/flat_map.h:283:31: error: no matching function for call to object of type 'key_compare' (aka 'std::less<void>')
    283 | if (found == tree::end() || tree::key_comp()(key, found->first))
    | ^~~~~~~~~~~~~~~~
    ../../ui/ozone/platform/drm/gpu/hardware_display_controller.cc:551:25: note: in instantiation of member function 'base::flat_map<gfx::Size, std::vector<std::unique_ptr<ui::DrmDumbBuffer>>>::operator[]' requested here
    551 | cursor_buffer_map_[size].push_back(

    ```

    Peter McNeeley

    You create a custom comparator for this type at the site of the flat_map

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 631, Patchset 5 (Latest): gfx::Size(std::min(max_cursor_size_supported.width(), 256),
    Peter McNeeley . unresolved

    You can name this magic number and resuse it elsewhere. This gives it semantic meaning.

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 46, Patchset 5 (Latest): std::vector<gfx::Size>* supported_cursor_sizes) {
    Peter McNeeley . unresolved

    Nit:
    Usually it is better to do this as a return value if you want to replace the list. Again this depends on if you are replacing vs adding.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jiahe Zhang
    • Sean Paul
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 5
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Attention: Sean Paul <sean...@chromium.org>
    Gerrit-Comment-Date: Mon, 15 Jul 2024 14:30:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Jiahe Zhang <jiahe...@intel.com>
    Comment-In-Reply-To: Peter McNeeley <peterm...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Peter McNeeley (Gerrit)

    unread,
    Jul 15, 2024, 3:42:47 PM7/15/24
    to Jiahe Zhang, Sean Paul, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang and Sean Paul

    Peter McNeeley added 1 comment

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 612, Patchset 5 (Latest): // If there are multiple CRTCs they should all have the same supported
    // cursor sizes.
    Peter McNeeley . unresolved

    I think this is going to be an intel assumption

    Gerrit-Comment-Date: Mon, 15 Jul 2024 19:42:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jiahe Zhang (Gerrit)

    unread,
    Jul 16, 2024, 5:28:37 AM7/16/24
    to Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Peter McNeeley and Sean Paul

    Jiahe Zhang voted and added 4 comments

    Votes added by Jiahe Zhang

    Commit-Queue+1

    4 comments

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 245, Patchset 4: base::flat_map<std::string, std::vector<std::unique_ptr<DrmDumbBuffer>>>
    Peter McNeeley . resolved

    We should really avoid using string. We should map to our types.

    Jiahe Zhang

    Done.

    Note:
    Directly using `base::flat_map<gfx::Size, ...>` here results in the following compile error, so `gfx::Rect` is used instead (or we will need to add `operator<` to `gfx::Size`.
    ```
    ../../base/containers/flat_map.h:283:31: error: no matching function for call to object of type 'key_compare' (aka 'std::less<void>')
    283 | if (found == tree::end() || tree::key_comp()(key, found->first))
    | ^~~~~~~~~~~~~~~~
    ../../ui/ozone/platform/drm/gpu/hardware_display_controller.cc:551:25: note: in instantiation of member function 'base::flat_map<gfx::Size, std::vector<std::unique_ptr<ui::DrmDumbBuffer>>>::operator[]' requested here
    551 | cursor_buffer_map_[size].push_back(

    ```

    Peter McNeeley

    You create a custom comparator for this type at the site of the flat_map

    Jiahe Zhang

    Done

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 612, Patchset 5: // If there are multiple CRTCs they should all have the same supported
    // cursor sizes.
    Peter McNeeley . unresolved

    I think this is going to be an intel assumption

    Jiahe Zhang

    Yes, this is true on Intel while other platforms don't have SIZE_HINTS values in the kernel.

    As this is already guarded by `*driver == "i915"`, should we keep the current code or, to be rigorous, only take the common elements from all CRTCs? WDYT?

    Line 631, Patchset 5: gfx::Size(std::min(max_cursor_size_supported.width(), 256),
    Peter McNeeley . resolved

    You can name this magic number and resuse it elsewhere. This gives it semantic meaning.

    Jiahe Zhang

    Done

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 46, Patchset 5: std::vector<gfx::Size>* supported_cursor_sizes) {
    Peter McNeeley . resolved

    Nit:
    Usually it is better to do this as a return value if you want to replace the list. Again this depends on if you are replacing vs adding.

    Jiahe Zhang

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Peter McNeeley
    • Sean Paul
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 6
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Attention: Sean Paul <sean...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Jul 2024 09:28:25 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sean Paul (Gerrit)

    unread,
    Jul 16, 2024, 2:11:35 PM7/16/24
    to Jiahe Zhang, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang and Peter McNeeley

    Sean Paul added 1 comment

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 47, Patchset 4: // TODO(jiahe.zhang): Remove this once libdrm is updated.
    Jiahe Zhang . unresolved

    The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

    Peter McNeeley

    @sean...@chromium.org Might know the status of things here.

    Sean Paul

    I'm not a big fan of this. I think we should update libdrm instead. @i...@chromium.org, do you have a pointer to how we would do this?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jiahe Zhang
    • Peter McNeeley
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 6
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Jul 2024 18:11:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gil Dekel (Gerrit)

    unread,
    Jul 17, 2024, 12:32:52 PM7/17/24
    to Jiahe Zhang, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang, Peter McNeeley and Sean Paul

    Gil Dekel added 10 comments

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 245, Patchset 6 (Latest): struct SizeCompare {
    bool operator()(const gfx::Size& a, const gfx::Size& b) const {
    if (a.GetArea() == b.GetArea()) {
    if (a.width() == b.width()) {
    return a.height() < b.height();
    } else {
    return a.width() < b.width();
    }
    } else {
    return a.GetArea() < b.GetArea();
    }
    }
    };
    Gil Dekel . unresolved

    You're doing a size comparison in the source file as well.

    You should move this to `ui/ozone/platform/drm/common/drm_util.h` [[1]](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/drm/common/drm_util.h) and call it something like `CursorSizeComparator`, and then use it both here and in `InitSupportedCursorSizes()`.

    Line 243, Patchset 6 (Latest): // |cursor_buffer_map_| stores active buffers for each
    // |supported_cursor_sizes_|.
    Gil Dekel . unresolved

    nit: This should be right above `cursor_buffer_map_`

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 609, Patchset 6 (Latest): DCHECK(!crtc_controllers_.empty());
    Gil Dekel . unresolved

    Sorry if I'm missing something, but why is this `DCHECK` needed here? is `crtc_controllers_` used below somehow?

    Line 610, Patchset 6 (Latest): const auto& planes = GetDrmDevice()->plane_manager()->planes();
    Gil Dekel . unresolved

    If the types are simple enough, please use them over `auto`. Here, below, and anywhere else.

    Line 612, Patchset 5: // If there are multiple CRTCs they should all have the same supported
    // cursor sizes.
    Peter McNeeley . unresolved

    I think this is going to be an intel assumption

    Jiahe Zhang

    Yes, this is true on Intel while other platforms don't have SIZE_HINTS values in the kernel.

    As this is already guarded by `*driver == "i915"`, should we keep the current code or, to be rigorous, only take the common elements from all CRTCs? WDYT?

    Gil Dekel

    I think there should be no assumptions at all and the cursor sizes inferred per CRTC. If this is already being done, then the comment is unnecessary.

    Line 611, Patchset 6 (Latest): for (const auto& plane : planes) {
    // Currently on Intel, if there are multiple CRTCs they should all have
    // the same supported cursor sizes.
    if (plane->type() == DRM_PLANE_TYPE_CURSOR) {
    const auto& supported_cursor_sizes = plane->supported_cursor_sizes();
    supported_cursor_sizes_.assign(supported_cursor_sizes.begin(),
    supported_cursor_sizes.end());
    break;
    }
    }
    }
    Gil Dekel . unresolved

    Please cover this case by a test. Test should be added to `ui/ozone/platform/drm/gpu/hardware_display_controller_unittest.cc`

    Line 625, Patchset 6 (Latest): gfx::Size max_cursor_size_supported = GetMaximumCursorSize(*GetDrmDevice());
    Gil Dekel . unresolved

    const

    Line 629, Patchset 6 (Latest): // Using a moderate size e.g. 256 for the cursor is enough in most cases.
    constexpr int kMaxCursorBufferSize = 256;
    Gil Dekel . unresolved

    Please move this to `ui/ozone/platform/drm/common/drm_util.h` [[1]](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/drm/common/drm_util.h)

    Line 640, Patchset 6 (Latest): [](const gfx::Size& a, const gfx::Size& b) {
    return a.GetArea() < b.GetArea();
    Gil Dekel . unresolved

    See my comment on reusing your cursor comparator.

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 47, Patchset 4: // TODO(jiahe.zhang): Remove this once libdrm is updated.
    Jiahe Zhang . unresolved

    The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

    Peter McNeeley

    @sean...@chromium.org Might know the status of things here.

    Sean Paul

    I'm not a big fan of this. I think we should update libdrm instead. @i...@chromium.org, do you have a pointer to how we would do this?

    Gil Dekel

    +1

    Let's prioritize updating libdrm first.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jiahe Zhang
    • Peter McNeeley
    • Sean Paul
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 6
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Attention: Sean Paul <sean...@chromium.org>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Comment-Date: Wed, 17 Jul 2024 16:32:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Jiahe Zhang <jiahe...@intel.com>
    Comment-In-Reply-To: Peter McNeeley <peterm...@chromium.org>
    Comment-In-Reply-To: Sean Paul <sean...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gil Dekel (Gerrit)

    unread,
    Jul 17, 2024, 12:43:23 PM7/17/24
    to Jiahe Zhang, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang, Peter McNeeley and Sean Paul

    Gil Dekel added 2 comments

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 560, Patchset 6 (Latest): gfx::Size buffer_size = supported_cursor_sizes_.back();
    Gil Dekel . unresolved

    Is this guaranteed to be populated? This feels risky to me. we should not make any assumptions here.

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 142, Patchset 6 (Latest): if (type_ == DRM_PLANE_TYPE_CURSOR && properties_.size_hints.id) {
    ScopedDrmPropertyBlobPtr size_hints_blob(
    drm->GetPropertyBlob(properties_.size_hints.value));
    if (size_hints_blob) {
    supported_cursor_sizes_ =
    ParseSupportedCursorSizes(size_hints_blob.get());
    }
    }
    Gil Dekel . unresolved

    Needs test overage as well.

    Gerrit-Comment-Date: Wed, 17 Jul 2024 16:43:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Peter McNeeley (Gerrit)

    unread,
    Jul 17, 2024, 3:25:25 PM7/17/24
    to Jiahe Zhang, Gil Dekel, Sean Paul, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Gil Dekel, Jiahe Zhang and Sean Paul

    Peter McNeeley added 1 comment

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 612, Patchset 5: // If there are multiple CRTCs they should all have the same supported
    // cursor sizes.
    Peter McNeeley . unresolved

    I think this is going to be an intel assumption

    Jiahe Zhang

    Yes, this is true on Intel while other platforms don't have SIZE_HINTS values in the kernel.

    As this is already guarded by `*driver == "i915"`, should we keep the current code or, to be rigorous, only take the common elements from all CRTCs? WDYT?

    Peter McNeeley

    I think it is fine. You might want to add that this is an intel assumption in the comments.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Gil Dekel
    • Jiahe Zhang
    • Sean Paul
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 6
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Attention: Gil Dekel <gild...@chromium.org>
    Gerrit-Attention: Sean Paul <sean...@chromium.org>
    Gerrit-Comment-Date: Wed, 17 Jul 2024 19:25:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jiahe Zhang (Gerrit)

    unread,
    Jul 24, 2024, 4:53:13 AM7/24/24
    to Ilja Friedel, Gil Dekel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Gil Dekel, Ilja Friedel, Peter McNeeley and Sean Paul

    Jiahe Zhang added 13 comments

    Patchset-level comments
    File-level comment, Patchset 8 (Latest):
    Jiahe Zhang . resolved

    Thanks! PTAL.

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 245, Patchset 6: struct SizeCompare {

    bool operator()(const gfx::Size& a, const gfx::Size& b) const {
    if (a.GetArea() == b.GetArea()) {
    if (a.width() == b.width()) {
    return a.height() < b.height();
    } else {
    return a.width() < b.width();
    }
    } else {
    return a.GetArea() < b.GetArea();
    }
    }
    };
    Gil Dekel . resolved

    You're doing a size comparison in the source file as well.

    You should move this to `ui/ozone/platform/drm/common/drm_util.h` [[1]](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/drm/common/drm_util.h) and call it something like `CursorSizeComparator`, and then use it both here and in `InitSupportedCursorSizes()`.

    Jiahe Zhang

    Done

    Line 243, Patchset 6: // |cursor_buffer_map_| stores active buffers for each
    // |supported_cursor_sizes_|.
    Gil Dekel . resolved

    nit: This should be right above `cursor_buffer_map_`

    Jiahe Zhang

    Done

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 560, Patchset 6: gfx::Size buffer_size = supported_cursor_sizes_.back();
    Gil Dekel . unresolved

    Is this guaranteed to be populated? This feels risky to me. we should not make any assumptions here.

    Jiahe Zhang

    `InitSupportedCursorSizes()` will make sure `supported_cursor_sizes_` has either 3 (the current value from SIZE_HINTS on Intel) elements, or 1 element (from the legacy `GetMaximumCursorSize()`) if reading SIZE_HINTS fails. We also have a DCHECK at the end of `InitSupportedCursorSizes()`.

    Line 609, Patchset 6: DCHECK(!crtc_controllers_.empty());
    Gil Dekel . resolved

    Sorry if I'm missing something, but why is this `DCHECK` needed here? is `crtc_controllers_` used below somehow?

    Jiahe Zhang

    Done
    `crtc_controllers_[0]` was used in a previous patchset and I forgot to remove this. We don't need it anymore now. Sorry for the confusing.

    Line 610, Patchset 6: const auto& planes = GetDrmDevice()->plane_manager()->planes();
    Gil Dekel . resolved

    If the types are simple enough, please use them over `auto`. Here, below, and anywhere else.

    Jiahe Zhang

    Done

    Line 612, Patchset 5: // If there are multiple CRTCs they should all have the same supported
    // cursor sizes.
    Peter McNeeley . resolved

    I think this is going to be an intel assumption

    Jiahe Zhang

    Yes, this is true on Intel while other platforms don't have SIZE_HINTS values in the kernel.

    As this is already guarded by `*driver == "i915"`, should we keep the current code or, to be rigorous, only take the common elements from all CRTCs? WDYT?

    Peter McNeeley

    I think it is fine. You might want to add that this is an intel assumption in the comments.

    Jiahe Zhang

    Acknowledged

    Line 611, Patchset 6: for (const auto& plane : planes) {

    // Currently on Intel, if there are multiple CRTCs they should all have
    // the same supported cursor sizes.
    if (plane->type() == DRM_PLANE_TYPE_CURSOR) {
    const auto& supported_cursor_sizes = plane->supported_cursor_sizes();
    supported_cursor_sizes_.assign(supported_cursor_sizes.begin(),
    supported_cursor_sizes.end());
    break;
    }
    }
    }
    Gil Dekel . resolved

    Please cover this case by a test. Test should be added to `ui/ozone/platform/drm/gpu/hardware_display_controller_unittest.cc`

    Jiahe Zhang

    Done

    Line 625, Patchset 6: gfx::Size max_cursor_size_supported = GetMaximumCursorSize(*GetDrmDevice());
    Gil Dekel . resolved

    const

    Jiahe Zhang

    Done

    Line 629, Patchset 6: // Using a moderate size e.g. 256 for the cursor is enough in most cases.

    constexpr int kMaxCursorBufferSize = 256;
    Gil Dekel . resolved

    Please move this to `ui/ozone/platform/drm/common/drm_util.h` [[1]](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/drm/common/drm_util.h)

    Jiahe Zhang

    Done

    Line 640, Patchset 6: [](const gfx::Size& a, const gfx::Size& b) {
    return a.GetArea() < b.GetArea();
    Gil Dekel . resolved

    See my comment on reusing your cursor comparator.

    Jiahe Zhang

    Done

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 47, Patchset 4: // TODO(jiahe.zhang): Remove this once libdrm is updated.
    Jiahe Zhang . unresolved

    The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

    Peter McNeeley

    @sean...@chromium.org Might know the status of things here.

    Sean Paul

    I'm not a big fan of this. I think we should update libdrm instead. @i...@chromium.org, do you have a pointer to how we would do this?

    Gil Dekel

    +1

    Let's prioritize updating libdrm first.

    Jiahe Zhang
    Line 142, Patchset 6: if (type_ == DRM_PLANE_TYPE_CURSOR && properties_.size_hints.id) {

    ScopedDrmPropertyBlobPtr size_hints_blob(
    drm->GetPropertyBlob(properties_.size_hints.value));
    if (size_hints_blob) {
    supported_cursor_sizes_ =
    ParseSupportedCursorSizes(size_hints_blob.get());
    }
    }
    Gil Dekel . resolved

    Needs test overage as well.

    Jiahe Zhang

    Done
    This should be covered by `HardwareDisplayControllerTest.DynamicCursorSize` now.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Gil Dekel
    • Ilja Friedel
    • Peter McNeeley
    • Sean Paul
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 8
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Ilja Friedel <i...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Gil Dekel <gild...@chromium.org>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Attention: Sean Paul <sean...@chromium.org>
    Gerrit-Attention: Ilja Friedel <i...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Jul 2024 08:53:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Jiahe Zhang <jiahe...@intel.com>
    Comment-In-Reply-To: Gil Dekel <gild...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jiahe Zhang (Gerrit)

    unread,
    Aug 2, 2024, 4:07:24 AM8/2/24
    to Ilja Friedel, Gil Dekel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Gil Dekel, Ilja Friedel, Peter McNeeley and Sean Paul

    Jiahe Zhang added 1 comment

    Patchset-level comments
    Jiahe Zhang . resolved

    Ping @gild...@chromium.org / @peterm...@chromium.org, any further comments on this patch?
    And ping @i...@chromium.org, please help on the libdrm updating (see the comments in hardware_display_plane.cc).
    Thanks a lot!

    Gerrit-Comment-Date: Fri, 02 Aug 2024 08:07:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gil Dekel (Gerrit)

    unread,
    Aug 2, 2024, 3:02:28 PM8/2/24
    to Jiahe Zhang, Ilja Friedel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Ilja Friedel, Jiahe Zhang, Peter McNeeley and Sean Paul

    Gil Dekel added 6 comments

    Patchset-level comments
    Gil Dekel . resolved

    I'll try to get ihf@'s attention on this

    File ui/ozone/platform/drm/gpu/fake_drm_device.cc
    Line 81, Patchset 8 (Latest): {kSizeHintsPropId, "SIZE_HINTS"},
    Gil Dekel . unresolved

    nit: Is this a required property name...? IIUC this is currently an i915 only property, and more generally, [a property](https://drmdb.emersion.fr/properties/4008636142/SIZE_HINTS) that is attached to `planes that support a very limited set of sizes.`

    Line 284, Patchset 8 (Latest): std::vector<drm_format_modifier> supported_format_modifiers,
    std::vector<gfx::Size> plane_size_hints) {
    Gil Dekel . unresolved

    I don't think these should be a part of the signature of this API, especially since `plane_size_hints` is currently an intel-only property. They make it increasingly more difficult to write tests if the caller always have to pass default or empty parameters here when they're not needed ([as seen here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/drm/gpu/fake_drm_device.h;l=286-295;drc=c1b9831c8c232ab9470645977a18527cfa7bb993;bpv=0;bpt=1)).

    I think we need a different mechanism of setting these props to planes for testing.

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 257, Patchset 8 (Latest): CursorSizeComparator>
    Gil Dekel . unresolved

    Thinking about this further - is there a reason for this map to be sorted...? Especially since `cursor_buffer_map_` is sorted when it's populated in `InitSupportedCursorSizes()`? It doesn't seem like you're trying to iterate over the keys.

    If that's the case, we should either leave the vector sorted and not worry about the map, or sort the map and not have the vector `supported_cursor_sizes_`.

    Line 200, Patchset 8 (Latest): return current_cursor_;
    Gil Dekel . unresolved

    Is returning it as a raw ptr safe in terms of resource life-time management..?

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 560, Patchset 6: gfx::Size buffer_size = supported_cursor_sizes_.back();
    Gil Dekel . resolved

    Is this guaranteed to be populated? This feels risky to me. we should not make any assumptions here.

    Jiahe Zhang

    `InitSupportedCursorSizes()` will make sure `supported_cursor_sizes_` has either 3 (the current value from SIZE_HINTS on Intel) elements, or 1 element (from the legacy `GetMaximumCursorSize()`) if reading SIZE_HINTS fails. We also have a DCHECK at the end of `InitSupportedCursorSizes()`.

    Gil Dekel

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ilja Friedel
    • Jiahe Zhang
    • Peter McNeeley
    • Sean Paul
    Gerrit-Attention: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Attention: Sean Paul <sean...@chromium.org>
    Gerrit-Attention: Ilja Friedel <i...@chromium.org>
    Gerrit-Comment-Date: Fri, 02 Aug 2024 19:02:17 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gil Dekel (Gerrit)

    unread,
    Aug 2, 2024, 3:32:32 PM8/2/24
    to Jiahe Zhang, Ilja Friedel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Ilja Friedel, Jiahe Zhang, Peter McNeeley and Sean Paul

    Gil Dekel added 1 comment

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 257, Patchset 8 (Latest): CursorSizeComparator>
    Gil Dekel . unresolved

    Thinking about this further - is there a reason for this map to be sorted...? Especially since `cursor_buffer_map_` is sorted when it's populated in `InitSupportedCursorSizes()`? It doesn't seem like you're trying to iterate over the keys.

    If that's the case, we should either leave the vector sorted and not worry about the map, or sort the map and not have the vector `supported_cursor_sizes_`.

    Gil Dekel

    Correction:

    Especially since `supported_cursor_sizes_` is sorted when it's populated in InitSupportedCursorSizes()?

    Gerrit-Comment-Date: Fri, 02 Aug 2024 19:32:23 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Gil Dekel <gild...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gil Dekel (Gerrit)

    unread,
    Aug 2, 2024, 4:15:49 PM8/2/24
    to Jiahe Zhang, Ilja Friedel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Ilja Friedel, Jiahe Zhang, Peter McNeeley and Sean Paul

    Gil Dekel added 1 comment

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 47, Patchset 4: // TODO(jiahe.zhang): Remove this once libdrm is updated.
    Jiahe Zhang . unresolved

    The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

    Peter McNeeley

    @sean...@chromium.org Might know the status of things here.

    Sean Paul

    I'm not a big fan of this. I think we should update libdrm instead. @i...@chromium.org, do you have a pointer to how we would do this?

    Gil Dekel

    +1

    Let's prioritize updating libdrm first.

    Jiahe Zhang

    Ping @i...@chromium.org .

    Gil Dekel

    libdrm is upreved to 2.4.122 in https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/5760406. Assuming no major complications, this should take about a week. Hopefully less.

    Thanks Ilja

    Gerrit-Comment-Date: Fri, 02 Aug 2024 20:15:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Jiahe Zhang <jiahe...@intel.com>
    Comment-In-Reply-To: Gil Dekel <gild...@chromium.org>
    Comment-In-Reply-To: Sean Paul <sean...@chromium.org>
    Comment-In-Reply-To: Peter McNeeley <peterm...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jiahe Zhang (Gerrit)

    unread,
    Aug 5, 2024, 6:04:02 AM8/5/24
    to Ilja Friedel, Gil Dekel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Gil Dekel and Peter McNeeley

    Jiahe Zhang voted and added 6 comments

    Votes added by Jiahe Zhang

    Commit-Queue+1

    6 comments

    Patchset-level comments
    File-level comment, Patchset 9 (Latest):
    Jiahe Zhang . resolved

    Thanks! PTAL.

    File ui/ozone/platform/drm/gpu/fake_drm_device.cc
    Line 81, Patchset 8: {kSizeHintsPropId, "SIZE_HINTS"},
    Gil Dekel . resolved

    nit: Is this a required property name...? IIUC this is currently an i915 only property, and more generally, [a property](https://drmdb.emersion.fr/properties/4008636142/SIZE_HINTS) that is attached to `planes that support a very limited set of sizes.`

    Jiahe Zhang

    Done. Moved this to the `kPlaneOptionalPropertyNames`.

    Line 284, Patchset 8: std::vector<drm_format_modifier> supported_format_modifiers,

    std::vector<gfx::Size> plane_size_hints) {
    Gil Dekel . resolved

    I don't think these should be a part of the signature of this API, especially since `plane_size_hints` is currently an intel-only property. They make it increasingly more difficult to write tests if the caller always have to pass default or empty parameters here when they're not needed ([as seen here](https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/drm/gpu/fake_drm_device.h;l=286-295;drc=c1b9831c8c232ab9470645977a18527cfa7bb993;bpv=0;bpt=1)).

    I think we need a different mechanism of setting these props to planes for testing.

    Jiahe Zhang

    Done

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 257, Patchset 8: CursorSizeComparator>
    Gil Dekel . unresolved

    Thinking about this further - is there a reason for this map to be sorted...? Especially since `cursor_buffer_map_` is sorted when it's populated in `InitSupportedCursorSizes()`? It doesn't seem like you're trying to iterate over the keys.

    If that's the case, we should either leave the vector sorted and not worry about the map, or sort the map and not have the vector `supported_cursor_sizes_`.

    Gil Dekel

    Correction:

    Especially since `supported_cursor_sizes_` is sorted when it's populated in InitSupportedCursorSizes()?

    Jiahe Zhang

    The only reason we need a comparator here is either `base::flat_map` or `std::map` requires it's type of key (aka `gfx::Size` here) can be compared, otherwise it cannot compile. So we either need a custom comparator like the current CL or add `operator<` to gfx::Size. Here's a previous discussion on this: https://chromium-review.googlesource.com/c/chromium/src/+/5587916/comment/88eb1626_93c88416/

    Line 200, Patchset 8: return current_cursor_;
    Gil Dekel . resolved

    Is returning it as a raw ptr safe in terms of resource life-time management..?

    Jiahe Zhang

    Done

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 47, Patchset 4: // TODO(jiahe.zhang): Remove this once libdrm is updated.
    Jiahe Zhang . resolved

    The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

    Peter McNeeley

    @sean...@chromium.org Might know the status of things here.

    Sean Paul

    I'm not a big fan of this. I think we should update libdrm instead. @i...@chromium.org, do you have a pointer to how we would do this?

    Gil Dekel

    +1

    Let's prioritize updating libdrm first.

    Jiahe Zhang

    Ping @i...@chromium.org .

    Gil Dekel

    libdrm is upreved to 2.4.122 in https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/5760406. Assuming no major complications, this should take about a week. Hopefully less.

    Thanks Ilja

    Jiahe Zhang

    Thanks a lot! I will update this CL once that gets merged.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Gil Dekel
    • Peter McNeeley
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 9
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Ilja Friedel <i...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Gil Dekel <gild...@chromium.org>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Comment-Date: Mon, 05 Aug 2024 10:03:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gil Dekel (Gerrit)

    unread,
    Aug 8, 2024, 1:09:31 PM8/8/24
    to Jiahe Zhang, Ilja Friedel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang, Peter McNeeley and Sean Paul

    Gil Dekel added 4 comments

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 195, Patchset 9 (Latest): size_t num_supported_cursor_sizes_for_testing() const {
    return supported_cursor_sizes_.size();
    }

    gfx::Size current_cursor_size_for_testing() const {
    return current_cursor_ ? current_cursor_->GetSize() : gfx::Size();
    }
    Gil Dekel . unresolved

    nit: these are no longer inline (one line). Please move implementation to the .cc file.

    Line 257, Patchset 8: CursorSizeComparator>
    Gil Dekel . resolved

    Thinking about this further - is there a reason for this map to be sorted...? Especially since `cursor_buffer_map_` is sorted when it's populated in `InitSupportedCursorSizes()`? It doesn't seem like you're trying to iterate over the keys.

    If that's the case, we should either leave the vector sorted and not worry about the map, or sort the map and not have the vector `supported_cursor_sizes_`.

    Gil Dekel

    Correction:

    Especially since `supported_cursor_sizes_` is sorted when it's populated in InitSupportedCursorSizes()?

    Jiahe Zhang

    The only reason we need a comparator here is either `base::flat_map` or `std::map` requires it's type of key (aka `gfx::Size` here) can be compared, otherwise it cannot compile. So we either need a custom comparator like the current CL or add `operator<` to gfx::Size. Here's a previous discussion on this: https://chromium-review.googlesource.com/c/chromium/src/+/5587916/comment/88eb1626_93c88416/

    Gil Dekel

    Acknowledged

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 604, Patchset 9 (Latest): std::optional<std::string> driver = GetDrmDevice()->GetDriverName();
    Gil Dekel . unresolved

    Do we still need this guard now that sizes are provided by a connector prop? Can't we instead assume whatever cursor sizes the planes report is valid? If not, can we make sure the planes are initialized with default cursor sizes? (either max size or `kMaxCursorBufferSize`)?

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 47, Patchset 4: // TODO(jiahe.zhang): Remove this once libdrm is updated.
    Jiahe Zhang . unresolved

    The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

    Peter McNeeley

    @sean...@chromium.org Might know the status of things here.

    Sean Paul

    I'm not a big fan of this. I think we should update libdrm instead. @i...@chromium.org, do you have a pointer to how we would do this?

    Gil Dekel

    +1

    Let's prioritize updating libdrm first.

    Jiahe Zhang

    Ping @i...@chromium.org .

    Gil Dekel

    libdrm is upreved to 2.4.122 in https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/5760406. Assuming no major complications, this should take about a week. Hopefully less.

    Thanks Ilja

    Jiahe Zhang

    Thanks a lot! I will update this CL once that gets merged.

    Gil Dekel

    Heads up: Once libdrm is upreved, you'll have to add this to `ui/ozone/platform/drm/common/scoped_drm_types.h` as a scoped type with a proper deleter and instantiate it in a similar way to how other libdrm types are instantiated in Chrome.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jiahe Zhang
    • Peter McNeeley
    • Sean Paul
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 9
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Ilja Friedel <i...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Attention: Sean Paul <sean...@chromium.org>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Comment-Date: Thu, 08 Aug 2024 17:09:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gil Dekel (Gerrit)

    unread,
    Aug 8, 2024, 1:13:02 PM8/8/24
    to Jiahe Zhang, Ilja Friedel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang, Peter McNeeley and Sean Paul

    Gil Dekel added 1 comment

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 47, Patchset 4: // TODO(jiahe.zhang): Remove this once libdrm is updated.
    Jiahe Zhang . unresolved

    The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

    Peter McNeeley

    @sean...@chromium.org Might know the status of things here.

    Sean Paul

    I'm not a big fan of this. I think we should update libdrm instead. @i...@chromium.org, do you have a pointer to how we would do this?

    Gil Dekel

    +1

    Let's prioritize updating libdrm first.

    Jiahe Zhang

    Ping @i...@chromium.org .

    Gil Dekel

    libdrm is upreved to 2.4.122 in https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/5760406. Assuming no major complications, this should take about a week. Hopefully less.

    Thanks Ilja

    Jiahe Zhang

    Thanks a lot! I will update this CL once that gets merged.

    Gil Dekel

    Heads up: Once libdrm is upreved, you'll have to add this to `ui/ozone/platform/drm/common/scoped_drm_types.h` as a scoped type with a proper deleter and instantiate it in a similar way to how other libdrm types are instantiated in Chrome.

    Gil Dekel

    Also it seems that the libdrm 2.4.122 is now live on CrOS R129-15985.0.0

    Gerrit-Comment-Date: Thu, 08 Aug 2024 17:12:54 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jiahe Zhang (Gerrit)

    unread,
    Aug 16, 2024, 5:12:09 AM8/16/24
    to Ilja Friedel, Gil Dekel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Gil Dekel and Peter McNeeley

    Jiahe Zhang added 3 comments

    File ui/ozone/platform/drm/gpu/hardware_display_controller.h
    Line 195, Patchset 9: size_t num_supported_cursor_sizes_for_testing() const {

    return supported_cursor_sizes_.size();
    }

    gfx::Size current_cursor_size_for_testing() const {
    return current_cursor_ ? current_cursor_->GetSize() : gfx::Size();
    }
    Gil Dekel . resolved

    nit: these are no longer inline (one line). Please move implementation to the .cc file.

    Jiahe Zhang

    Done

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 604, Patchset 9: std::optional<std::string> driver = GetDrmDevice()->GetDriverName();
    Gil Dekel . unresolved

    Do we still need this guard now that sizes are provided by a connector prop? Can't we instead assume whatever cursor sizes the planes report is valid? If not, can we make sure the planes are initialized with default cursor sizes? (either max size or `kMaxCursorBufferSize`)?

    Jiahe Zhang

    The only concern is that we have an Intel specific assumption below that all CRTCs have the same supported cursor sizes. As currently only i915 implements the SIZE_HINTS, I'm not sure if other drivers will follow the same assumption in the future.

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 47, Patchset 4: // TODO(jiahe.zhang): Remove this once libdrm is updated.
    Jiahe Zhang . unresolved

    The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

    Peter McNeeley

    @sean...@chromium.org Might know the status of things here.

    Sean Paul

    I'm not a big fan of this. I think we should update libdrm instead. @i...@chromium.org, do you have a pointer to how we would do this?

    Gil Dekel

    +1

    Let's prioritize updating libdrm first.

    Jiahe Zhang

    Ping @i...@chromium.org .

    Gil Dekel

    libdrm is upreved to 2.4.122 in https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/5760406. Assuming no major complications, this should take about a week. Hopefully less.

    Thanks Ilja

    Jiahe Zhang

    Thanks a lot! I will update this CL once that gets merged.

    Gil Dekel

    Heads up: Once libdrm is upreved, you'll have to add this to `ui/ozone/platform/drm/common/scoped_drm_types.h` as a scoped type with a proper deleter and instantiate it in a similar way to how other libdrm types are instantiated in Chrome.

    Gil Dekel

    Also it seems that the libdrm 2.4.122 is now live on CrOS R129-15985.0.0

    Jiahe Zhang

    Heads up: Once libdrm is upreved, you'll have to add this to ui/ozone/platform/drm/common/scoped_drm_types.h as a scoped type with a proper deleter and instantiate it in a similar way to how other libdrm types are instantiated in Chrome.

    We don't actually instantiate a `drm_plane_size_hint` here, but just cast something from `blob->data`, whose lifecycle should be managed properly by `ScopedDrmPropertyBlobPtr` (like the `ParseSupportedFormatsAndModifiers` above). So it seems we don't need a deleter here, WDYT?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Gil Dekel
    • Peter McNeeley
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 10
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Ilja Friedel <i...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Gil Dekel <gild...@chromium.org>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Comment-Date: Fri, 16 Aug 2024 09:11:37 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gil Dekel (Gerrit)

    unread,
    Aug 19, 2024, 3:49:53 PM8/19/24
    to Jiahe Zhang, Ilja Friedel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang, Peter McNeeley and Sean Paul

    Gil Dekel added 2 comments

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 604, Patchset 9: std::optional<std::string> driver = GetDrmDevice()->GetDriverName();
    Gil Dekel . unresolved

    Do we still need this guard now that sizes are provided by a connector prop? Can't we instead assume whatever cursor sizes the planes report is valid? If not, can we make sure the planes are initialized with default cursor sizes? (either max size or `kMaxCursorBufferSize`)?

    Jiahe Zhang

    The only concern is that we have an Intel specific assumption below that all CRTCs have the same supported cursor sizes. As currently only i915 implements the SIZE_HINTS, I'm not sure if other drivers will follow the same assumption in the future.

    Gil Dekel

    Ok. Perhaps not for this CL, but can we modify the code so that it doesn't make this assumption and that each CRTC is checked against the cursor sizes in a follow-up CL?

    I would rather keep Ozone/DRM agnostic to drivers when possible, and since those are properties available via DRM resources, I believe it can be done.

    File ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    Line 47, Patchset 4: // TODO(jiahe.zhang): Remove this once libdrm is updated.
    Jiahe Zhang . resolved

    The definition of `drm_plane_size_hint` is already in the upstream libdrm, but I don't know how to update libdrm in Chromium/ChromiumOS. Any hints?

    Peter McNeeley

    @sean...@chromium.org Might know the status of things here.

    Sean Paul

    I'm not a big fan of this. I think we should update libdrm instead. @i...@chromium.org, do you have a pointer to how we would do this?

    Gil Dekel

    +1

    Let's prioritize updating libdrm first.

    Jiahe Zhang

    Ping @i...@chromium.org .

    Gil Dekel

    libdrm is upreved to 2.4.122 in https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/5760406. Assuming no major complications, this should take about a week. Hopefully less.

    Thanks Ilja

    Jiahe Zhang

    Thanks a lot! I will update this CL once that gets merged.

    Gil Dekel

    Heads up: Once libdrm is upreved, you'll have to add this to `ui/ozone/platform/drm/common/scoped_drm_types.h` as a scoped type with a proper deleter and instantiate it in a similar way to how other libdrm types are instantiated in Chrome.

    Gil Dekel

    Also it seems that the libdrm 2.4.122 is now live on CrOS R129-15985.0.0

    Jiahe Zhang

    Heads up: Once libdrm is upreved, you'll have to add this to ui/ozone/platform/drm/common/scoped_drm_types.h as a scoped type with a proper deleter and instantiate it in a similar way to how other libdrm types are instantiated in Chrome.

    We don't actually instantiate a `drm_plane_size_hint` here, but just cast something from `blob->data`, whose lifecycle should be managed properly by `ScopedDrmPropertyBlobPtr` (like the `ParseSupportedFormatsAndModifiers` above). So it seems we don't need a deleter here, WDYT?

    Gil Dekel

    Ok, if that's the case then it's probably fine to skip. I'll take a look at the code once you update it to use libdrm instead.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jiahe Zhang
    • Peter McNeeley
    • Sean Paul
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 10
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Ilja Friedel <i...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Attention: Sean Paul <sean...@chromium.org>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Comment-Date: Mon, 19 Aug 2024 19:49:46 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jiahe Zhang (Gerrit)

    unread,
    Aug 21, 2024, 6:37:53 AM8/21/24
    to Ilja Friedel, Gil Dekel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Gil Dekel and Peter McNeeley

    Jiahe Zhang added 2 comments

    Patchset-level comments
    File-level comment, Patchset 10 (Latest):
    Jiahe Zhang . resolved

    Code has already been updated using the libdrm. PTAL.

    File ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    Line 604, Patchset 9: std::optional<std::string> driver = GetDrmDevice()->GetDriverName();
    Gil Dekel . resolved

    Do we still need this guard now that sizes are provided by a connector prop? Can't we instead assume whatever cursor sizes the planes report is valid? If not, can we make sure the planes are initialized with default cursor sizes? (either max size or `kMaxCursorBufferSize`)?

    Jiahe Zhang

    The only concern is that we have an Intel specific assumption below that all CRTCs have the same supported cursor sizes. As currently only i915 implements the SIZE_HINTS, I'm not sure if other drivers will follow the same assumption in the future.

    Gil Dekel

    Ok. Perhaps not for this CL, but can we modify the code so that it doesn't make this assumption and that each CRTC is checked against the cursor sizes in a follow-up CL?

    I would rather keep Ozone/DRM agnostic to drivers when possible, and since those are properties available via DRM resources, I believe it can be done.

    Jiahe Zhang

    OK, I'll try to do this in a follow-up CL.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Gil Dekel
    • Peter McNeeley
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 10
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Ilja Friedel <i...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Gil Dekel <gild...@chromium.org>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Comment-Date: Wed, 21 Aug 2024 10:37:43 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gil Dekel (Gerrit)

    unread,
    Aug 22, 2024, 1:32:56 PM8/22/24
    to Jiahe Zhang, Ilja Friedel, Sean Paul, Peter McNeeley, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang and Peter McNeeley

    Gil Dekel voted and added 1 comment

    Votes added by Gil Dekel

    Code-Review+1

    1 comment

    Patchset-level comments
    Gil Dekel . resolved

    Thanks for your hard work on this!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jiahe Zhang
    • Peter McNeeley
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 10
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Ilja Friedel <i...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Attention: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Comment-Date: Thu, 22 Aug 2024 17:32:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Peter McNeeley (Gerrit)

    unread,
    Aug 22, 2024, 2:52:49 PM8/22/24
    to Jiahe Zhang, Gil Dekel, Ilja Friedel, Sean Paul, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org
    Attention needed from Jiahe Zhang

    Peter McNeeley voted and added 1 comment

    Votes added by Peter McNeeley

    Code-Review+1

    1 comment

    Patchset-level comments
    Peter McNeeley . resolved

    (tagging along)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jiahe Zhang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 10
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Ilja Friedel <i...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Attention: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Comment-Date: Thu, 22 Aug 2024 18:52:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Jiahe Zhang (Gerrit)

    unread,
    Aug 22, 2024, 10:34:37 PM8/22/24
    to Peter McNeeley, Gil Dekel, Ilja Friedel, Sean Paul, Drew Davenport, Chen-Yu Tsai, Chromium LUCI CQ, Jianhui J Dai, AyeAye, ozone-...@chromium.org

    Jiahe Zhang voted and added 1 comment

    Votes added by Jiahe Zhang

    Commit-Queue+2

    1 comment

    Patchset-level comments
    Jiahe Zhang . resolved

    Thanks!

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 10
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    Gerrit-CC: Drew Davenport <ddave...@chromium.org>
    Gerrit-CC: Ilja Friedel <i...@chromium.org>
    Gerrit-CC: Jianhui J Dai <jianhu...@intel.com>
    Gerrit-Comment-Date: Fri, 23 Aug 2024 02:34:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Aug 22, 2024, 11:04:50 PM8/22/24
    to Jiahe Zhang, Peter McNeeley, Gil Dekel, Ilja Friedel, Sean Paul, Drew Davenport, Chen-Yu Tsai, Jianhui J Dai, AyeAye, ozone-...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    Use SIZE_HINTS property for cursor buffer size instead of probing

    The previous probing of supported cursor sizes causes issues on some
    devices. This CL replaces that with SIZE_HINTS property of cursor
    plane and uses the max size if SIZE_HINTS is not available. This
    feature is currently behind a flag UseDynamicCursorSize.
    Bug: 326156501
    Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Reviewed-by: Peter McNeeley <peterm...@chromium.org>
    Commit-Queue: Jiahe Zhang <jiahe...@intel.com>
    Reviewed-by: Gil Dekel <gild...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1345782}
    Files:
    • M ui/ozone/platform/drm/common/drm_util.h
    • M ui/ozone/platform/drm/gpu/crtc_controller.cc
    • M ui/ozone/platform/drm/gpu/crtc_controller.h
    • M ui/ozone/platform/drm/gpu/fake_drm_device.cc
    • M ui/ozone/platform/drm/gpu/fake_drm_device.h
    • M ui/ozone/platform/drm/gpu/hardware_display_controller.cc
    • M ui/ozone/platform/drm/gpu/hardware_display_controller.h
    • M ui/ozone/platform/drm/gpu/hardware_display_controller_unittest.cc
    • M ui/ozone/platform/drm/gpu/hardware_display_plane.cc
    • M ui/ozone/platform/drm/gpu/hardware_display_plane.h
    Change size: L
    Delta: 10 files changed, 203 insertions(+), 74 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Peter McNeeley, +1 by Gil Dekel
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia06e449dd899b09595521a74b0f5093631062b4e
    Gerrit-Change-Number: 5587916
    Gerrit-PatchSet: 11
    Gerrit-Owner: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Gil Dekel <gild...@chromium.org>
    Gerrit-Reviewer: Jiahe Zhang <jiahe...@intel.com>
    Gerrit-Reviewer: Peter McNeeley <peterm...@chromium.org>
    Gerrit-Reviewer: Sean Paul <sean...@chromium.org>
    Gerrit-CC: Chen-Yu Tsai <we...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages