|
15 | 15 | #include "i9xx_plane.h" |
16 | 16 | #include "i9xx_plane_regs.h" |
17 | 17 | #include "intel_atomic.h" |
18 | | -#include "intel_atomic_plane.h" |
| 18 | +#include "intel_bo.h" |
19 | 19 | #include "intel_de.h" |
20 | 20 | #include "intel_display_irq.h" |
21 | 21 | #include "intel_display_regs.h" |
22 | 22 | #include "intel_display_types.h" |
23 | 23 | #include "intel_fb.h" |
24 | 24 | #include "intel_fbc.h" |
25 | 25 | #include "intel_frontbuffer.h" |
| 26 | +#include "intel_plane.h" |
26 | 27 | #include "intel_sprite.h" |
27 | 28 |
|
28 | 29 | /* Primary plane formats for gen <= 3 */ |
@@ -336,10 +337,10 @@ i9xx_plane_check(struct intel_crtc_state *crtc_state, |
336 | 337 | if (ret) |
337 | 338 | return ret; |
338 | 339 |
|
339 | | - ret = intel_atomic_plane_check_clipping(plane_state, crtc_state, |
340 | | - DRM_PLANE_NO_SCALING, |
341 | | - DRM_PLANE_NO_SCALING, |
342 | | - i9xx_plane_has_windowing(plane)); |
| 340 | + ret = intel_plane_check_clipping(plane_state, crtc_state, |
| 341 | + DRM_PLANE_NO_SCALING, |
| 342 | + DRM_PLANE_NO_SCALING, |
| 343 | + i9xx_plane_has_windowing(plane)); |
343 | 344 | if (ret) |
344 | 345 | return ret; |
345 | 346 |
|
@@ -905,6 +906,27 @@ static const struct drm_plane_funcs i8xx_plane_funcs = { |
905 | 906 | .format_mod_supported_async = intel_plane_format_mod_supported_async, |
906 | 907 | }; |
907 | 908 |
|
| 909 | +static void i9xx_disable_tiling(struct intel_plane *plane) |
| 910 | +{ |
| 911 | + struct intel_display *display = to_intel_display(plane); |
| 912 | + enum i9xx_plane_id i9xx_plane = plane->i9xx_plane; |
| 913 | + u32 dspcntr; |
| 914 | + u32 reg; |
| 915 | + |
| 916 | + dspcntr = intel_de_read_fw(display, DSPCNTR(display, i9xx_plane)); |
| 917 | + dspcntr &= ~DISP_TILED; |
| 918 | + intel_de_write_fw(display, DSPCNTR(display, i9xx_plane), dspcntr); |
| 919 | + |
| 920 | + if (DISPLAY_VER(display) >= 4) { |
| 921 | + reg = intel_de_read_fw(display, DSPSURF(display, i9xx_plane)); |
| 922 | + intel_de_write_fw(display, DSPSURF(display, i9xx_plane), reg); |
| 923 | + |
| 924 | + } else { |
| 925 | + reg = intel_de_read_fw(display, DSPADDR(display, i9xx_plane)); |
| 926 | + intel_de_write_fw(display, DSPADDR(display, i9xx_plane), reg); |
| 927 | + } |
| 928 | +} |
| 929 | + |
908 | 930 | struct intel_plane * |
909 | 931 | intel_primary_plane_create(struct intel_display *display, enum pipe pipe) |
910 | 932 | { |
@@ -1047,6 +1069,8 @@ intel_primary_plane_create(struct intel_display *display, enum pipe pipe) |
1047 | 1069 | } |
1048 | 1070 | } |
1049 | 1071 |
|
| 1072 | + plane->disable_tiling = i9xx_disable_tiling; |
| 1073 | + |
1050 | 1074 | modifiers = intel_fb_plane_get_modifiers(display, INTEL_PLANE_CAP_TILING_X); |
1051 | 1075 |
|
1052 | 1076 | if (DISPLAY_VER(display) >= 5 || display->platform.g4x) |
@@ -1151,7 +1175,7 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc, |
1151 | 1175 |
|
1152 | 1176 | drm_WARN_ON(display->drm, pipe != crtc->pipe); |
1153 | 1177 |
|
1154 | | - intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL); |
| 1178 | + intel_fb = intel_bo_alloc_framebuffer(); |
1155 | 1179 | if (!intel_fb) { |
1156 | 1180 | drm_dbg_kms(display->drm, "failed to alloc fb\n"); |
1157 | 1181 | return; |
|
0 commit comments