File tree 3 files changed +39
-2
lines changed
drivers/gpu/drm/rp1/rp1-dpi
3 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -7,5 +7,10 @@ config DRM_RP1_DPI
7
7
select DRM_VRAM_HELPER
8
8
select DRM_TTM
9
9
select DRM_TTM_HELPER
10
+ depends on RP1_PIO || !RP1_PIO
10
11
help
11
- Choose this option to enable Video Out on RP1
12
+ Choose this option to enable DPI output on Raspberry Pi RP1
13
+
14
+ There is an optional dependency on RP1_PIO, as the PIO block
15
+ must be used to fix up interlaced sync. Interlaced DPI modes
16
+ will be unavailable when RP1_PIO is not selected.
Original file line number Diff line number Diff line change @@ -217,12 +217,28 @@ static void rp1dpi_pipe_disable_vblank(struct drm_simple_display_pipe *pipe)
217
217
rp1dpi_hw_vblank_ctrl (dpi , 0 );
218
218
}
219
219
220
+ static enum drm_mode_status rp1dpi_pipe_mode_valid (struct drm_simple_display_pipe * pipe ,
221
+ const struct drm_display_mode * mode )
222
+ {
223
+ #if !IS_REACHABLE (CONFIG_RP1_PIO )
224
+ if (mode -> flags & DRM_MODE_FLAG_INTERLACE )
225
+ return MODE_NO_INTERLACE ;
226
+ #endif
227
+ if (mode -> clock < 1000 ) /* 1 MHz */
228
+ return MODE_CLOCK_LOW ;
229
+ if (mode -> clock > 200000 ) /* 200 MHz */
230
+ return MODE_CLOCK_HIGH ;
231
+
232
+ return MODE_OK ;
233
+ }
234
+
220
235
static const struct drm_simple_display_pipe_funcs rp1dpi_pipe_funcs = {
221
236
.enable = rp1dpi_pipe_enable ,
222
237
.update = rp1dpi_pipe_update ,
223
238
.disable = rp1dpi_pipe_disable ,
224
239
.enable_vblank = rp1dpi_pipe_enable_vblank ,
225
240
.disable_vblank = rp1dpi_pipe_disable_vblank ,
241
+ .mode_valid = rp1dpi_pipe_mode_valid ,
226
242
};
227
243
228
244
static const struct drm_mode_config_funcs rp1dpi_mode_funcs = {
Original file line number Diff line number Diff line change 18
18
#include <linux/kernel.h>
19
19
#include <linux/errno.h>
20
20
#include <linux/of.h>
21
- #include <linux/pio_rp1.h>
22
21
#include <linux/pinctrl/consumer.h>
23
22
#include <linux/platform_device.h>
24
23
#include <drm/drm_print.h>
25
24
26
25
#include "rp1_dpi.h"
27
26
27
+ #if IS_REACHABLE (CONFIG_RP1_PIO )
28
+
29
+ #include <linux/pio_rp1.h>
30
+
28
31
/*
29
32
* Start a PIO SM to generate an interrupt just after HSYNC onset, then another
30
33
* after a fixed delay (during which we assume HSYNC will have been deasserted).
@@ -223,3 +226,16 @@ void rp1dpi_pio_stop(struct rp1_dpi *dpi)
223
226
dpi -> pio = NULL ;
224
227
}
225
228
}
229
+
230
+ #else /* !IS_REACHABLE(CONFIG_RP1_PIO) */
231
+
232
+ int rp1dpi_pio_start (struct rp1_dpi * dpi , const struct drm_display_mode * mode )
233
+ {
234
+ return - ENODEV ;
235
+ }
236
+
237
+ void rp1dpi_pio_stop (struct rp1_dpi * dpi )
238
+ {
239
+ }
240
+
241
+ #endif
You can’t perform that action at this time.
0 commit comments