diff options
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 12 | ||||
-rw-r--r-- | drivers/video/fbmon.c | 8 | ||||
-rw-r--r-- | drivers/video/of_display_timing.c | 19 | ||||
-rw-r--r-- | drivers/video/videomode.c | 3 | ||||
-rw-r--r-- | include/video/display_timing.h | 26 | ||||
-rw-r--r-- | include/video/videomode.h | 3 |
6 files changed, 32 insertions, 39 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 0698c0e9bc26..f83f0719922e 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
@@ -523,17 +523,17 @@ int drm_display_mode_from_videomode(const struct videomode *vm, | |||
523 | dmode->clock = vm->pixelclock / 1000; | 523 | dmode->clock = vm->pixelclock / 1000; |
524 | 524 | ||
525 | dmode->flags = 0; | 525 | dmode->flags = 0; |
526 | if (vm->dmt_flags & VESA_DMT_HSYNC_HIGH) | 526 | if (vm->flags & DISPLAY_FLAGS_HSYNC_HIGH) |
527 | dmode->flags |= DRM_MODE_FLAG_PHSYNC; | 527 | dmode->flags |= DRM_MODE_FLAG_PHSYNC; |
528 | else if (vm->dmt_flags & VESA_DMT_HSYNC_LOW) | 528 | else if (vm->flags & DISPLAY_FLAGS_HSYNC_LOW) |
529 | dmode->flags |= DRM_MODE_FLAG_NHSYNC; | 529 | dmode->flags |= DRM_MODE_FLAG_NHSYNC; |
530 | if (vm->dmt_flags & VESA_DMT_VSYNC_HIGH) | 530 | if (vm->flags & DISPLAY_FLAGS_VSYNC_HIGH) |
531 | dmode->flags |= DRM_MODE_FLAG_PVSYNC; | 531 | dmode->flags |= DRM_MODE_FLAG_PVSYNC; |
532 | else if (vm->dmt_flags & VESA_DMT_VSYNC_LOW) | 532 | else if (vm->flags & DISPLAY_FLAGS_VSYNC_LOW) |
533 | dmode->flags |= DRM_MODE_FLAG_NVSYNC; | 533 | dmode->flags |= DRM_MODE_FLAG_NVSYNC; |
534 | if (vm->data_flags & DISPLAY_FLAGS_INTERLACED) | 534 | if (vm->flags & DISPLAY_FLAGS_INTERLACED) |
535 | dmode->flags |= DRM_MODE_FLAG_INTERLACE; | 535 | dmode->flags |= DRM_MODE_FLAG_INTERLACE; |
536 | if (vm->data_flags & DISPLAY_FLAGS_DOUBLESCAN) | 536 | if (vm->flags & DISPLAY_FLAGS_DOUBLESCAN) |
537 | dmode->flags |= DRM_MODE_FLAG_DBLSCAN; | 537 | dmode->flags |= DRM_MODE_FLAG_DBLSCAN; |
538 | drm_mode_set_name(dmode); | 538 | drm_mode_set_name(dmode); |
539 | 539 | ||
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c index 368cedfeaf1d..e5cc2fdb4c8d 100644 --- a/drivers/video/fbmon.c +++ b/drivers/video/fbmon.c | |||
@@ -1398,13 +1398,13 @@ int fb_videomode_from_videomode(const struct videomode *vm, | |||
1398 | 1398 | ||
1399 | fbmode->sync = 0; | 1399 | fbmode->sync = 0; |
1400 | fbmode->vmode = 0; | 1400 | fbmode->vmode = 0; |
1401 | if (vm->dmt_flags & VESA_DMT_HSYNC_HIGH) | 1401 | if (vm->flags & DISPLAY_FLAGS_HSYNC_HIGH) |
1402 | fbmode->sync |= FB_SYNC_HOR_HIGH_ACT; | 1402 | fbmode->sync |= FB_SYNC_HOR_HIGH_ACT; |
1403 | if (vm->dmt_flags & VESA_DMT_HSYNC_HIGH) | 1403 | if (vm->flags & DISPLAY_FLAGS_HSYNC_HIGH) |
1404 | fbmode->sync |= FB_SYNC_VERT_HIGH_ACT; | 1404 | fbmode->sync |= FB_SYNC_VERT_HIGH_ACT; |
1405 | if (vm->data_flags & DISPLAY_FLAGS_INTERLACED) | 1405 | if (vm->flags & DISPLAY_FLAGS_INTERLACED) |
1406 | fbmode->vmode |= FB_VMODE_INTERLACED; | 1406 | fbmode->vmode |= FB_VMODE_INTERLACED; |
1407 | if (vm->data_flags & DISPLAY_FLAGS_DOUBLESCAN) | 1407 | if (vm->flags & DISPLAY_FLAGS_DOUBLESCAN) |
1408 | fbmode->vmode |= FB_VMODE_DOUBLE; | 1408 | fbmode->vmode |= FB_VMODE_DOUBLE; |
1409 | fbmode->flag = 0; | 1409 | fbmode->flag = 0; |
1410 | 1410 | ||
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index 13ecd9897010..56009bc02b02 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c | |||
@@ -79,25 +79,24 @@ static struct display_timing *of_get_display_timing(struct device_node *np) | |||
79 | ret |= parse_timing_property(np, "vsync-len", &dt->vsync_len); | 79 | ret |= parse_timing_property(np, "vsync-len", &dt->vsync_len); |
80 | ret |= parse_timing_property(np, "clock-frequency", &dt->pixelclock); | 80 | ret |= parse_timing_property(np, "clock-frequency", &dt->pixelclock); |
81 | 81 | ||
82 | dt->dmt_flags = 0; | 82 | dt->flags = 0; |
83 | dt->data_flags = 0; | ||
84 | if (!of_property_read_u32(np, "vsync-active", &val)) | 83 | if (!of_property_read_u32(np, "vsync-active", &val)) |
85 | dt->dmt_flags |= val ? VESA_DMT_VSYNC_HIGH : | 84 | dt->flags |= val ? DISPLAY_FLAGS_VSYNC_HIGH : |
86 | VESA_DMT_VSYNC_LOW; | 85 | DISPLAY_FLAGS_VSYNC_LOW; |
87 | if (!of_property_read_u32(np, "hsync-active", &val)) | 86 | if (!of_property_read_u32(np, "hsync-active", &val)) |
88 | dt->dmt_flags |= val ? VESA_DMT_HSYNC_HIGH : | 87 | dt->flags |= val ? DISPLAY_FLAGS_HSYNC_HIGH : |
89 | VESA_DMT_HSYNC_LOW; | 88 | DISPLAY_FLAGS_HSYNC_LOW; |
90 | if (!of_property_read_u32(np, "de-active", &val)) | 89 | if (!of_property_read_u32(np, "de-active", &val)) |
91 | dt->data_flags |= val ? DISPLAY_FLAGS_DE_HIGH : | 90 | dt->flags |= val ? DISPLAY_FLAGS_DE_HIGH : |
92 | DISPLAY_FLAGS_DE_LOW; | 91 | DISPLAY_FLAGS_DE_LOW; |
93 | if (!of_property_read_u32(np, "pixelclk-active", &val)) | 92 | if (!of_property_read_u32(np, "pixelclk-active", &val)) |
94 | dt->data_flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE : | 93 | dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE : |
95 | DISPLAY_FLAGS_PIXDATA_NEGEDGE; | 94 | DISPLAY_FLAGS_PIXDATA_NEGEDGE; |
96 | 95 | ||
97 | if (of_property_read_bool(np, "interlaced")) | 96 | if (of_property_read_bool(np, "interlaced")) |
98 | dt->data_flags |= DISPLAY_FLAGS_INTERLACED; | 97 | dt->flags |= DISPLAY_FLAGS_INTERLACED; |
99 | if (of_property_read_bool(np, "doublescan")) | 98 | if (of_property_read_bool(np, "doublescan")) |
100 | dt->data_flags |= DISPLAY_FLAGS_DOUBLESCAN; | 99 | dt->flags |= DISPLAY_FLAGS_DOUBLESCAN; |
101 | 100 | ||
102 | if (ret) { | 101 | if (ret) { |
103 | pr_err("%s: error reading timing properties\n", | 102 | pr_err("%s: error reading timing properties\n", |
diff --git a/drivers/video/videomode.c b/drivers/video/videomode.c index 21c47a202afa..810afff79bc1 100644 --- a/drivers/video/videomode.c +++ b/drivers/video/videomode.c | |||
@@ -31,8 +31,7 @@ int videomode_from_timing(const struct display_timings *disp, | |||
31 | vm->vback_porch = display_timing_get_value(&dt->vback_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); | 32 | vm->vsync_len = display_timing_get_value(&dt->vsync_len, TE_TYP); |
33 | 33 | ||
34 | vm->dmt_flags = dt->dmt_flags; | 34 | vm->flags = dt->flags; |
35 | vm->data_flags = dt->data_flags; | ||
36 | 35 | ||
37 | return 0; | 36 | return 0; |
38 | } | 37 | } |
diff --git a/include/video/display_timing.h b/include/video/display_timing.h index 71e9a383a981..a8a4be5b0af7 100644 --- a/include/video/display_timing.h +++ b/include/video/display_timing.h | |||
@@ -12,19 +12,16 @@ | |||
12 | #include <linux/bitops.h> | 12 | #include <linux/bitops.h> |
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | 14 | ||
15 | /* VESA display monitor timing parameters */ | 15 | #define DISPLAY_FLAGS_HSYNC_LOW BIT(0) |
16 | #define VESA_DMT_HSYNC_LOW BIT(0) | 16 | #define DISPLAY_FLAGS_HSYNC_HIGH BIT(1) |
17 | #define VESA_DMT_HSYNC_HIGH BIT(1) | 17 | #define DISPLAY_FLAGS_VSYNC_LOW BIT(2) |
18 | #define VESA_DMT_VSYNC_LOW BIT(2) | 18 | #define DISPLAY_FLAGS_VSYNC_HIGH BIT(3) |
19 | #define VESA_DMT_VSYNC_HIGH BIT(3) | 19 | #define DISPLAY_FLAGS_DE_LOW BIT(4) /* data enable flag */ |
20 | 20 | #define DISPLAY_FLAGS_DE_HIGH BIT(5) | |
21 | /* display specific flags */ | 21 | #define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(6) /* drive data on pos. edge */ |
22 | #define DISPLAY_FLAGS_DE_LOW BIT(0) /* data enable flag */ | 22 | #define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(7) /* drive data on neg. edge */ |
23 | #define DISPLAY_FLAGS_DE_HIGH BIT(1) | 23 | #define DISPLAY_FLAGS_INTERLACED BIT(8) |
24 | #define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(2) /* drive data on pos. edge */ | 24 | #define DISPLAY_FLAGS_DOUBLESCAN BIT(9) |
25 | #define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(3) /* drive data on neg. edge */ | ||
26 | #define DISPLAY_FLAGS_INTERLACED BIT(4) | ||
27 | #define DISPLAY_FLAGS_DOUBLESCAN BIT(5) | ||
28 | 25 | ||
29 | /* | 26 | /* |
30 | * A single signal can be specified via a range of minimal and maximal values | 27 | * A single signal can be specified via a range of minimal and maximal values |
@@ -72,8 +69,7 @@ struct display_timing { | |||
72 | struct timing_entry vback_porch; /* ver. back porch */ | 69 | struct timing_entry vback_porch; /* ver. back porch */ |
73 | struct timing_entry vsync_len; /* ver. sync len */ | 70 | struct timing_entry vsync_len; /* ver. sync len */ |
74 | 71 | ||
75 | unsigned int dmt_flags; /* VESA DMT flags */ | 72 | unsigned int flags; /* display flags */ |
76 | unsigned int data_flags; /* video data flags */ | ||
77 | }; | 73 | }; |
78 | 74 | ||
79 | /* | 75 | /* |
diff --git a/include/video/videomode.h b/include/video/videomode.h index a42156234dd4..f4ae6edfeb08 100644 --- a/include/video/videomode.h +++ b/include/video/videomode.h | |||
@@ -29,8 +29,7 @@ struct videomode { | |||
29 | u32 vback_porch; | 29 | u32 vback_porch; |
30 | u32 vsync_len; | 30 | u32 vsync_len; |
31 | 31 | ||
32 | unsigned int dmt_flags; /* VESA DMT flags */ | 32 | unsigned int flags; /* display flags */ |
33 | unsigned int data_flags; /* video data flags */ | ||
34 | }; | 33 | }; |
35 | 34 | ||
36 | /** | 35 | /** |