Skip to content

Commit 05569b5

Browse files
committed
drm/i915/display: Simplify intel_joiner_num_pipes and its usage
jira NONE_AUTOMATION Rebuild_History Non-Buildable kernel-5.14.0-570.18.1.el9_6 commit-author Ankit Nautiyal <ankit.k.nautiyal@intel.com> commit eb920fb Currently intel_joiner_num_pipes is used to get num of pipes wrt num of pipes joined. Simplify this by returning 1 when no joiner is used and update the checks for no joiner case. v2: Rename the function to intel_crtc_num_joined_pipes and use helper intel_crtc_joined_pipe_mask. (Ville) Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240916102836.2149012-2-ankit.k.nautiyal@intel.com (cherry picked from commit eb920fb) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent f99b03e commit 05569b5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ bool intel_crtc_is_joiner_primary(const struct intel_crtc_state *crtc_state)
277277
crtc->pipe == joiner_primary_pipe(crtc_state);
278278
}
279279

280-
static int intel_joiner_num_pipes(const struct intel_crtc_state *crtc_state)
280+
static int intel_crtc_num_joined_pipes(const struct intel_crtc_state *crtc_state)
281281
{
282-
return hweight8(crtc_state->joiner_pipes);
282+
return hweight8(intel_crtc_joined_pipe_mask(crtc_state));
283283
}
284284

285285
u8 intel_crtc_joined_pipe_mask(const struct intel_crtc_state *crtc_state)
@@ -2343,9 +2343,9 @@ static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state)
23432343
static void intel_joiner_adjust_timings(const struct intel_crtc_state *crtc_state,
23442344
struct drm_display_mode *mode)
23452345
{
2346-
int num_pipes = intel_joiner_num_pipes(crtc_state);
2346+
int num_pipes = intel_crtc_num_joined_pipes(crtc_state);
23472347

2348-
if (num_pipes < 2)
2348+
if (num_pipes == 1)
23492349
return;
23502350

23512351
mode->crtc_clock /= num_pipes;
@@ -2407,7 +2407,7 @@ static void intel_crtc_readout_derived_state(struct intel_crtc_state *crtc_state
24072407
drm_mode_copy(mode, pipe_mode);
24082408
intel_mode_from_crtc_timings(mode, mode);
24092409
mode->hdisplay = drm_rect_width(&crtc_state->pipe_src) *
2410-
(intel_joiner_num_pipes(crtc_state) ?: 1);
2410+
intel_crtc_num_joined_pipes(crtc_state);
24112411
mode->vdisplay = drm_rect_height(&crtc_state->pipe_src);
24122412

24132413
/* Derive per-pipe timings in case joiner is used */
@@ -2427,10 +2427,10 @@ void intel_encoder_get_config(struct intel_encoder *encoder,
24272427

24282428
static void intel_joiner_compute_pipe_src(struct intel_crtc_state *crtc_state)
24292429
{
2430-
int num_pipes = intel_joiner_num_pipes(crtc_state);
2430+
int num_pipes = intel_crtc_num_joined_pipes(crtc_state);
24312431
int width, height;
24322432

2433-
if (num_pipes < 2)
2433+
if (num_pipes == 1)
24342434
return;
24352435

24362436
width = drm_rect_width(&crtc_state->pipe_src);
@@ -2887,11 +2887,11 @@ static void intel_get_transcoder_timings(struct intel_crtc *crtc,
28872887
static void intel_joiner_adjust_pipe_src(struct intel_crtc_state *crtc_state)
28882888
{
28892889
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
2890-
int num_pipes = intel_joiner_num_pipes(crtc_state);
2890+
int num_pipes = intel_crtc_num_joined_pipes(crtc_state);
28912891
enum pipe primary_pipe, pipe = crtc->pipe;
28922892
int width;
28932893

2894-
if (num_pipes < 2)
2894+
if (num_pipes == 1)
28952895
return;
28962896

28972897
primary_pipe = joiner_primary_pipe(crtc_state);

0 commit comments

Comments
 (0)