public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/bridge: analogix_dp: Add support for optional data-lanes mapping
Date: Fri, 05 Jun 2026 06:34:43 +1000	[thread overview]
Message-ID: <review-patch4-20260604085220.2862986-5-damon.ding@rock-chips.com> (raw)
In-Reply-To: <20260604085220.2862986-5-damon.ding@rock-chips.com>

Patch Review

**Status: Mostly good, a few observations**

The overall implementation is correct. The parsing logic properly validates lane values and checks for duplicates. The fill-in logic for unused lanes when fewer than 4 data-lanes are specified is reasonable:

```c
for (i = 0; i < LANE_COUNT4 && num_lanes < LANE_COUNT4; i++) {
	if (!used[i])
		map[num_lanes++] = i;
}
```

The `analogix_dp_lane_mapping()` register write using shift constants is cleaner than the old hardcoded approach.

**Observations:**

1. **Double endpoint lookup**: `analogix_dp_dt_parse_lanes_map()` first calls `drm_of_get_data_lanes_count_ep()` to get the count, then calls `of_graph_get_endpoint_by_regs()` + `of_property_read_u32_array()` to read the values. `drm_of_get_data_lanes_count_ep` already looks up the endpoint internally and reads `data-lanes`. Consider whether it's possible to just do a single endpoint lookup and read `data-lanes` directly, getting both count and values in one pass. This would also avoid the subtle inconsistency that `drm_of_get_data_lanes_count_ep` uses port_reg=1,reg=0 while `of_graph_get_endpoint_by_regs` uses port=1,reg=-1 (first endpoint).

2. **Error return on missing data-lanes**: `drm_of_get_data_lanes_count_ep` returns a negative error when no `data-lanes` property exists. The function returns `-EINVAL` in this case, which is then silently caught by the caller:
   ```c
   if (analogix_dp_dt_parse_lanes_map(dp))
       dev_dbg(dp->dev, "No valid data-lanes found, using default lane map\n");
   ```
   The initial `memcpy(video_info->lane_map, map, sizeof(map))` at the top of the function ensures the default `{0, 1, 2, 3}` is always set, which is correct.

3. **Parentheses in shift defines**: Minor style nit — the new defines use unnecessary parentheses around the values:
   ```c
   #define LANE3_MAP_SHIFT				(6)
   #define LANE2_MAP_SHIFT				(4)
   ```
   While not wrong, this is inconsistent with many other shift defines in the same file that don't use parentheses (e.g., the existing `LANE*_MAP_LOGIC_LANE_*` defines use `(0x1 << 6)` syntax where the parens wrap the expression, not bare integers). Very minor.

4. **`LANE_COUNT4` as array size**: Using the enum value `LANE_COUNT4 = 4` as an array dimension and loop bound works since its value is 4, but it mixes enum semantics (a lane-count option) with "number of DP lanes total." A named constant like `DP_MAX_LANES` or `ANALOGIX_DP_MAX_LANES` would be self-documenting, though this is a pre-existing pattern in the codebase.

The register-level change from `analogix_dp_lane_swap()` to `analogix_dp_lane_mapping()` is clean — the old hardcoded swap/no-swap is replaced by a generic mapping write that produces the same result for the default `{0,1,2,3}` map.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-06-04 20:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04  8:52 [PATCH v5 0/4] Add eDP lane mapping support Damon Ding
2026-06-04  8:52 ` [PATCH v5 1/4] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint Damon Ding
2026-06-04  9:06   ` sashiko-bot
2026-06-04 18:43     ` Rob Herring
2026-06-04 20:34   ` Claude review: " Claude Code Review Bot
2026-06-04  8:52 ` [PATCH v5 2/4] drm/dp: Add helper to validate DP lane counts Damon Ding
2026-06-04 20:34   ` Claude review: " Claude Code Review Bot
2026-06-04  8:52 ` [PATCH v5 3/4] drm/bridge: analogix_dp: Add validation for samsung, lane-count property Damon Ding
2026-06-04  9:09   ` [PATCH v5 3/4] drm/bridge: analogix_dp: Add validation for samsung,lane-count property sashiko-bot
2026-06-04 20:34   ` Claude review: drm/bridge: analogix_dp: Add validation for samsung, lane-count property Claude Code Review Bot
2026-06-04  8:52 ` [PATCH v5 4/4] drm/bridge: analogix_dp: Add support for optional data-lanes mapping Damon Ding
2026-06-04  9:04   ` sashiko-bot
2026-06-04 20:34   ` Claude Code Review Bot [this message]
2026-06-04 20:34 ` Claude review: Add eDP lane mapping support Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-25  9:47 [PATCH v3 0/2] " Damon Ding
2026-05-25  9:47 ` [PATCH v3 2/2] drm/bridge: analogix_dp: Add support for optional data-lanes mapping Damon Ding
2026-05-25 21:20   ` Claude review: " Claude Code Review Bot
2026-05-21 11:44 [PATCH v2 0/3] Add eDP lane mapping support Damon Ding
2026-05-21 11:44 ` [PATCH v2 3/3] drm/bridge: analogix_dp: Add support for optional data-lanes mapping Damon Ding
2026-05-25 10:15   ` Claude review: " Claude Code Review Bot
2026-05-14  7:01 [PATCH v1 0/3] Add eDP lane mapping support Damon Ding
2026-05-14  7:01 ` [PATCH v1 3/3] drm/bridge: analogix_dp: Add support for optional data-lanes mapping Damon Ding
2026-05-16  1:13   ` Claude review: " Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-patch4-20260604085220.2862986-5-damon.ding@rock-chips.com \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox