diff options
author | Gustavo Diaz Prado <x0083741@ti.com> | 2011-08-25 02:57:49 -0400 |
---|---|---|
committer | Paolo Pisati <paolo.pisati@canonical.com> | 2012-08-17 04:18:34 -0400 |
commit | bbf748104b5abd431ab8e6da3ee83ae929130f89 (patch) | |
tree | 9336c1f28da68299e3bc4c8c40f319fd9bdf41bb | |
parent | e5c56e3f2836a840c3996d0c885ca06ad150b3b3 (diff) |
OMAP4: SGX: Rebasing virtual display code
This patch rebases the virtual display code according to the new
DSS structures changes to make it work on 2.6.35
Signed-off-by: Gustavo Diaz Prado <x0083741@ti.com>
-rw-r--r-- | drivers/gpu/pvr/display/omap_display.c | 41 | ||||
-rw-r--r-- | drivers/gpu/pvr/display/omap_display.h | 4 | ||||
-rw-r--r-- | drivers/gpu/pvr/display/omap_sgx_displayclass.c | 5 |
3 files changed, 31 insertions, 19 deletions
diff --git a/drivers/gpu/pvr/display/omap_display.c b/drivers/gpu/pvr/display/omap_display.c index 1fb5f353870..1f130753c46 100644 --- a/drivers/gpu/pvr/display/omap_display.c +++ b/drivers/gpu/pvr/display/omap_display.c | |||
@@ -16,6 +16,7 @@ | |||
16 | * this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/slab.h> | ||
19 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
20 | #include <linux/module.h> | 21 | #include <linux/module.h> |
21 | #include <linux/fb.h> | 22 | #include <linux/fb.h> |
@@ -424,6 +425,7 @@ static int present_buffer(struct omap_display_buffer *buffer) | |||
424 | struct omapfb2_device *fbdev = ofbi->fbdev; | 425 | struct omapfb2_device *fbdev = ofbi->fbdev; |
425 | struct omap_overlay *overlay; | 426 | struct omap_overlay *overlay; |
426 | struct omap_overlay_info overlay_info; | 427 | struct omap_overlay_info overlay_info; |
428 | struct omap_dss_device *dss_device; | ||
427 | int i; | 429 | int i; |
428 | 430 | ||
429 | omapfb_lock(fbdev); | 431 | omapfb_lock(fbdev); |
@@ -443,14 +445,21 @@ static int present_buffer(struct omap_display_buffer *buffer) | |||
443 | 445 | ||
444 | if (overlay->manager) { | 446 | if (overlay->manager) { |
445 | overlay->manager->apply(overlay->manager); | 447 | overlay->manager->apply(overlay->manager); |
446 | if (overlay->manager->device && | 448 | dss_device = overlay->manager->device; |
447 | overlay->manager->device->update) { | 449 | /* |
448 | overlay->manager->device->update( | 450 | * FIXME: Is the update really needed? |
449 | overlay->manager->device, | 451 | * On 2.6.35 calling this code triggers a bug |
452 | */ | ||
453 | #if 0 | ||
454 | if (dss_device && | ||
455 | dss_device->driver->update) { | ||
456 | dss_device->driver->update( | ||
457 | dss_device, | ||
450 | 0, 0, | 458 | 0, 0, |
451 | overlay_info.width, | 459 | overlay_info.width, |
452 | overlay_info.height); | 460 | overlay_info.height); |
453 | } | 461 | } |
462 | #endif | ||
454 | } | 463 | } |
455 | } | 464 | } |
456 | 465 | ||
@@ -613,13 +622,13 @@ static int present_buffer_sync_virtual(struct omap_display_buffer *buffer) | |||
613 | static int display_sync(struct omap_display_device *display) | 622 | static int display_sync(struct omap_display_device *display) |
614 | { | 623 | { |
615 | /* TODO: Synchronize properly with multiple managers */ | 624 | /* TODO: Synchronize properly with multiple managers */ |
616 | struct omap_dss_device *dss_device = | 625 | struct omap_overlay_manager *manager = |
617 | display->overlay_managers[0]->device; | 626 | display->overlay_managers[0]; |
618 | if (!dss_device || !dss_device->wait_vsync) { | 627 | if (!manager) { |
619 | ERR_PRINT("Unable to synchronize with '%s'", display->name); | 628 | ERR_PRINT("Unable to synchronize with '%s'", display->name); |
620 | return 1; | 629 | return 1; |
621 | } | 630 | } |
622 | dss_device->wait_vsync(dss_device); | 631 | manager->wait_for_vsync(manager); |
623 | return 0; | 632 | return 0; |
624 | } | 633 | } |
625 | 634 | ||
@@ -758,7 +767,7 @@ static int populate_display_info(struct omap_display_device *display, | |||
758 | if (!strcmp(dss_device->name, "lcd")) { | 767 | if (!strcmp(dss_device->name, "lcd")) { |
759 | display->id = OMAP_DISPID_PRIMARY; | 768 | display->id = OMAP_DISPID_PRIMARY; |
760 | display->name = "primary"; | 769 | display->name = "primary"; |
761 | } else if (!strcmp(dss_device->name, "2lcd")) { | 770 | } else if (!strcmp(dss_device->name, "lcd2")) { |
762 | display->id = OMAP_DISPID_SECONDARY; | 771 | display->id = OMAP_DISPID_SECONDARY; |
763 | display->name = "secondary"; | 772 | display->name = "secondary"; |
764 | } else if (!strcmp(dss_device->name, "hdmi")) { | 773 | } else if (!strcmp(dss_device->name, "hdmi")) { |
@@ -769,7 +778,7 @@ static int populate_display_info(struct omap_display_device *display, | |||
769 | return 1; | 778 | return 1; |
770 | } | 779 | } |
771 | 780 | ||
772 | dss_device->get_resolution(dss_device, &xres, &yres); | 781 | dss_device->driver->get_resolution(dss_device, &xres, &yres); |
773 | if (xres == 0 || yres == 0) { | 782 | if (xres == 0 || yres == 0) { |
774 | ERR_PRINT("Unable to handle display '%s' with width %i " | 783 | ERR_PRINT("Unable to handle display '%s' with width %i " |
775 | "and height %i", dss_device->name, xres, yres); | 784 | "and height %i", dss_device->name, xres, yres); |
@@ -779,7 +788,8 @@ static int populate_display_info(struct omap_display_device *display, | |||
779 | display->width = xres; | 788 | display->width = xres; |
780 | display->height = yres; | 789 | display->height = yres; |
781 | 790 | ||
782 | display->bits_per_pixel = dss_device->get_recommended_bpp(dss_device); | 791 | display->bits_per_pixel = |
792 | dss_device->driver->get_recommended_bpp(dss_device); | ||
783 | switch (display->bits_per_pixel) { | 793 | switch (display->bits_per_pixel) { |
784 | case 16: | 794 | case 16: |
785 | /* | 795 | /* |
@@ -951,7 +961,6 @@ static int populate_virtual_display_info(struct omap_display_device *display) | |||
951 | static int create_display_list(void) | 961 | static int create_display_list(void) |
952 | { | 962 | { |
953 | int i; | 963 | int i; |
954 | unsigned int bytes_to_alloc; | ||
955 | struct omap_display_device *display; | 964 | struct omap_display_device *display; |
956 | 965 | ||
957 | /* Query number of possible displays available first */ | 966 | /* Query number of possible displays available first */ |
@@ -1026,7 +1035,7 @@ int omap_display_count(void) | |||
1026 | } | 1035 | } |
1027 | EXPORT_SYMBOL(omap_display_count); | 1036 | EXPORT_SYMBOL(omap_display_count); |
1028 | 1037 | ||
1029 | int omap_display_init(void) | 1038 | int omap_display_initialize(void) |
1030 | { | 1039 | { |
1031 | /* | 1040 | /* |
1032 | * TODO: Is there a better way to check if list is already created? | 1041 | * TODO: Is there a better way to check if list is already created? |
@@ -1040,9 +1049,9 @@ int omap_display_init(void) | |||
1040 | } | 1049 | } |
1041 | return 0; | 1050 | return 0; |
1042 | } | 1051 | } |
1043 | EXPORT_SYMBOL(omap_display_init); | 1052 | EXPORT_SYMBOL(omap_display_initialize); |
1044 | 1053 | ||
1045 | int omap_display_deinit(void) | 1054 | int omap_display_deinitialize(void) |
1046 | { | 1055 | { |
1047 | int i; | 1056 | int i; |
1048 | int err = 0; | 1057 | int err = 0; |
@@ -1074,5 +1083,5 @@ int omap_display_deinit(void) | |||
1074 | 1083 | ||
1075 | return err; | 1084 | return err; |
1076 | } | 1085 | } |
1077 | EXPORT_SYMBOL(omap_display_deinit); | 1086 | EXPORT_SYMBOL(omap_display_deinitialize); |
1078 | 1087 | ||
diff --git a/drivers/gpu/pvr/display/omap_display.h b/drivers/gpu/pvr/display/omap_display.h index 13916a9461f..71b9dac23b1 100644 --- a/drivers/gpu/pvr/display/omap_display.h +++ b/drivers/gpu/pvr/display/omap_display.h | |||
@@ -101,8 +101,8 @@ struct omap_display_device { | |||
101 | int (*present_buffer_sync) (struct omap_display_buffer *buffer); | 101 | int (*present_buffer_sync) (struct omap_display_buffer *buffer); |
102 | }; | 102 | }; |
103 | 103 | ||
104 | int omap_display_init(void); | 104 | int omap_display_initialize(void); |
105 | int omap_display_deinit(void); | 105 | int omap_display_deinitialize(void); |
106 | int omap_display_count(void); | 106 | int omap_display_count(void); |
107 | struct omap_display_device *omap_display_get(enum omap_display_id id); | 107 | struct omap_display_device *omap_display_get(enum omap_display_id id); |
108 | 108 | ||
diff --git a/drivers/gpu/pvr/display/omap_sgx_displayclass.c b/drivers/gpu/pvr/display/omap_sgx_displayclass.c index 7b493f1d94e..fce8f67ac20 100644 --- a/drivers/gpu/pvr/display/omap_sgx_displayclass.c +++ b/drivers/gpu/pvr/display/omap_sgx_displayclass.c | |||
@@ -24,6 +24,7 @@ | |||
24 | * | 24 | * |
25 | *************************************************************************/ | 25 | *************************************************************************/ |
26 | 26 | ||
27 | #include <linux/slab.h> | ||
27 | #include <linux/version.h> | 28 | #include <linux/version.h> |
28 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
29 | #include <linux/console.h> | 30 | #include <linux/console.h> |
@@ -1307,8 +1308,10 @@ static enum OMAP_ERROR create_display_devices(void) | |||
1307 | 1308 | ||
1308 | DEBUG_PRINTK("Initializing 3rd party display driver"); | 1309 | DEBUG_PRINTK("Initializing 3rd party display driver"); |
1309 | 1310 | ||
1311 | /* Init display abstraction layer */ | ||
1312 | omap_display_initialize(); | ||
1313 | |||
1310 | /* Ask for the number of displays available */ | 1314 | /* Ask for the number of displays available */ |
1311 | omap_display_init(); | ||
1312 | /* TODO: allow more displays */ | 1315 | /* TODO: allow more displays */ |
1313 | display_devices_count = 1; // omap_display_count(); | 1316 | display_devices_count = 1; // omap_display_count(); |
1314 | 1317 | ||