aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/videomode.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/videomode.c')
-rw-r--r--drivers/video/videomode.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/drivers/video/videomode.c b/drivers/video/videomode.c
index 21c47a202afa..df375c96c5d3 100644
--- a/drivers/video/videomode.c
+++ b/drivers/video/videomode.c
@@ -11,7 +11,25 @@
11#include <video/display_timing.h> 11#include <video/display_timing.h>
12#include <video/videomode.h> 12#include <video/videomode.h>
13 13
14int videomode_from_timing(const struct display_timings *disp, 14void videomode_from_timing(const struct display_timing *dt,
15 struct videomode *vm)
16{
17 vm->pixelclock = dt->pixelclock.typ;
18 vm->hactive = dt->hactive.typ;
19 vm->hfront_porch = dt->hfront_porch.typ;
20 vm->hback_porch = dt->hback_porch.typ;
21 vm->hsync_len = dt->hsync_len.typ;
22
23 vm->vactive = dt->vactive.typ;
24 vm->vfront_porch = dt->vfront_porch.typ;
25 vm->vback_porch = dt->vback_porch.typ;
26 vm->vsync_len = dt->vsync_len.typ;
27
28 vm->flags = dt->flags;
29}
30EXPORT_SYMBOL_GPL(videomode_from_timing);
31
32int videomode_from_timings(const struct display_timings *disp,
15 struct videomode *vm, unsigned int index) 33 struct videomode *vm, unsigned int index)
16{ 34{
17 struct display_timing *dt; 35 struct display_timing *dt;
@@ -20,20 +38,8 @@ int videomode_from_timing(const struct display_timings *disp,
20 if (!dt) 38 if (!dt)
21 return -EINVAL; 39 return -EINVAL;
22 40
23 vm->pixelclock = display_timing_get_value(&dt->pixelclock, TE_TYP); 41 videomode_from_timing(dt, vm);
24 vm->hactive = display_timing_get_value(&dt->hactive, TE_TYP);
25 vm->hfront_porch = display_timing_get_value(&dt->hfront_porch, TE_TYP);
26 vm->hback_porch = display_timing_get_value(&dt->hback_porch, TE_TYP);
27 vm->hsync_len = display_timing_get_value(&dt->hsync_len, TE_TYP);
28
29 vm->vactive = display_timing_get_value(&dt->vactive, TE_TYP);
30 vm->vfront_porch = display_timing_get_value(&dt->vfront_porch, TE_TYP);
31 vm->vback_porch = display_timing_get_value(&dt->vback_porch, TE_TYP);
32 vm->vsync_len = display_timing_get_value(&dt->vsync_len, TE_TYP);
33
34 vm->dmt_flags = dt->dmt_flags;
35 vm->data_flags = dt->data_flags;
36 42
37 return 0; 43 return 0;
38} 44}
39EXPORT_SYMBOL_GPL(videomode_from_timing); 45EXPORT_SYMBOL_GPL(videomode_from_timings);