Skip to content

Commit 1aba671

Browse files
juhapekkahogander
authored andcommitted
drm/i915/display: Separate xe and i915 common dpt code into own file
Here created intel_dpt_common.c to hold intel_dpt_configure which is needed for both xe and i915. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Signed-off-by: Jouni Högander <jouni.hogander@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231116150225.204233-1-juhapekka.heikkila@gmail.com
1 parent 07e823c commit 1aba671

6 files changed

Lines changed: 49 additions & 28 deletions

File tree

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ i915-y += \
275275
display/intel_dpll.o \
276276
display/intel_dpll_mgr.o \
277277
display/intel_dpt.o \
278+
display/intel_dpt_common.o \
278279
display/intel_drrs.o \
279280
display/intel_dsb.o \
280281
display/intel_dsb_buffer.o \

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#include "intel_dpll.h"
7777
#include "intel_dpll_mgr.h"
7878
#include "intel_dpt.h"
79+
#include "intel_dpt_common.h"
7980
#include "intel_drrs.h"
8081
#include "intel_dsb.h"
8182
#include "intel_dsi.h"

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include "gt/gen8_ppgtt.h"
1010

1111
#include "i915_drv.h"
12-
#include "i915_reg.h"
13-
#include "intel_de.h"
1412
#include "intel_display_types.h"
1513
#include "intel_dpt.h"
1614
#include "intel_fb.h"
@@ -318,27 +316,3 @@ void intel_dpt_destroy(struct i915_address_space *vm)
318316
i915_vm_put(&dpt->vm);
319317
}
320318

321-
void intel_dpt_configure(struct intel_crtc *crtc)
322-
{
323-
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
324-
325-
if (DISPLAY_VER(i915) == 14) {
326-
enum pipe pipe = crtc->pipe;
327-
enum plane_id plane_id;
328-
329-
for_each_plane_id_on_crtc(crtc, plane_id) {
330-
if (plane_id == PLANE_CURSOR)
331-
continue;
332-
333-
intel_de_rmw(i915, PLANE_CHICKEN(pipe, plane_id),
334-
PLANE_CHICKEN_DISABLE_DPT,
335-
i915->display.params.enable_dpt ? 0 :
336-
PLANE_CHICKEN_DISABLE_DPT);
337-
}
338-
} else if (DISPLAY_VER(i915) == 13) {
339-
intel_de_rmw(i915, CHICKEN_MISC_2,
340-
CHICKEN_MISC_DISABLE_DPT,
341-
i915->display.params.enable_dpt ? 0 :
342-
CHICKEN_MISC_DISABLE_DPT);
343-
}
344-
}

drivers/gpu/drm/i915/display/intel_dpt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ struct drm_i915_private;
1010

1111
struct i915_address_space;
1212
struct i915_vma;
13-
struct intel_crtc;
1413
struct intel_framebuffer;
1514

1615
void intel_dpt_destroy(struct i915_address_space *vm);
@@ -20,6 +19,5 @@ void intel_dpt_suspend(struct drm_i915_private *i915);
2019
void intel_dpt_resume(struct drm_i915_private *i915);
2120
struct i915_address_space *
2221
intel_dpt_create(struct intel_framebuffer *fb);
23-
void intel_dpt_configure(struct intel_crtc *crtc);
2422

2523
#endif /* __INTEL_DPT_H__ */
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Copyright © 2023 Intel Corporation
4+
*/
5+
6+
#include "i915_reg.h"
7+
#include "intel_de.h"
8+
#include "intel_display_types.h"
9+
#include "intel_dpt_common.h"
10+
11+
void intel_dpt_configure(struct intel_crtc *crtc)
12+
{
13+
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
14+
15+
if (DISPLAY_VER(i915) == 14) {
16+
enum pipe pipe = crtc->pipe;
17+
enum plane_id plane_id;
18+
19+
for_each_plane_id_on_crtc(crtc, plane_id) {
20+
if (plane_id == PLANE_CURSOR)
21+
continue;
22+
23+
intel_de_rmw(i915, PLANE_CHICKEN(pipe, plane_id),
24+
PLANE_CHICKEN_DISABLE_DPT,
25+
i915->display.params.enable_dpt ? 0 :
26+
PLANE_CHICKEN_DISABLE_DPT);
27+
}
28+
} else if (DISPLAY_VER(i915) == 13) {
29+
intel_de_rmw(i915, CHICKEN_MISC_2,
30+
CHICKEN_MISC_DISABLE_DPT,
31+
i915->display.params.enable_dpt ? 0 :
32+
CHICKEN_MISC_DISABLE_DPT);
33+
}
34+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/*
3+
* Copyright © 2023 Intel Corporation
4+
*/
5+
6+
#ifndef __INTEL_DPT_COMMON_H__
7+
#define __INTEL_DPT_COMMON_H__
8+
9+
struct intel_crtc;
10+
11+
void intel_dpt_configure(struct intel_crtc *crtc);
12+
13+
#endif /* __INTEL_DPT_COMMON_H__ */

0 commit comments

Comments
 (0)