diff options
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 13 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 30 | ||||
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-ioctl.c | 4 |
3 files changed, 12 insertions, 35 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index e6d0954f459f..5f78d3851d91 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -847,6 +847,10 @@ static int taal_memory_read(struct omap_dss_device *dssdev, | |||
847 | int first = 1; | 847 | int first = 1; |
848 | int plen; | 848 | int plen; |
849 | unsigned buf_used = 0; | 849 | unsigned buf_used = 0; |
850 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); | ||
851 | |||
852 | if (!td->enabled) | ||
853 | return -ENODEV; | ||
850 | 854 | ||
851 | if (size < w * h * 3) | 855 | if (size < w * h * 3) |
852 | return -ENOMEM; | 856 | return -ENOMEM; |
@@ -855,6 +859,8 @@ static int taal_memory_read(struct omap_dss_device *dssdev, | |||
855 | dssdev->panel.timings.x_res * | 859 | dssdev->panel.timings.x_res * |
856 | dssdev->panel.timings.y_res * 3); | 860 | dssdev->panel.timings.y_res * 3); |
857 | 861 | ||
862 | dsi_bus_lock(); | ||
863 | |||
858 | /* plen 1 or 2 goes into short packet. until checksum error is fixed, | 864 | /* plen 1 or 2 goes into short packet. until checksum error is fixed, |
859 | * use short packets. plen 32 works, but bigger packets seem to cause | 865 | * use short packets. plen 32 works, but bigger packets seem to cause |
860 | * an error. */ | 866 | * an error. */ |
@@ -863,11 +869,11 @@ static int taal_memory_read(struct omap_dss_device *dssdev, | |||
863 | else | 869 | else |
864 | plen = 2; | 870 | plen = 2; |
865 | 871 | ||
866 | taal_setup_update(dssdev, x, y, w, h); | 872 | taal_set_update_window(x, y, w, h); |
867 | 873 | ||
868 | r = dsi_vc_set_max_rx_packet_size(TCH, plen); | 874 | r = dsi_vc_set_max_rx_packet_size(TCH, plen); |
869 | if (r) | 875 | if (r) |
870 | return r; | 876 | goto err0; |
871 | 877 | ||
872 | while (buf_used < size) { | 878 | while (buf_used < size) { |
873 | u8 dcs_cmd = first ? 0x2e : 0x3e; | 879 | u8 dcs_cmd = first ? 0x2e : 0x3e; |
@@ -900,7 +906,8 @@ static int taal_memory_read(struct omap_dss_device *dssdev, | |||
900 | 906 | ||
901 | err: | 907 | err: |
902 | dsi_vc_set_max_rx_packet_size(TCH, 1); | 908 | dsi_vc_set_max_rx_packet_size(TCH, 1); |
903 | 909 | err0: | |
910 | dsi_bus_unlock(); | ||
904 | return r; | 911 | return r; |
905 | } | 912 | } |
906 | 913 | ||
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index f01c9ca0fa5f..638d8c29e9d9 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -3584,34 +3584,6 @@ static bool dsi_display_get_mirror(struct omap_dss_device *dssdev) | |||
3584 | return dssdev->driver->get_mirror(dssdev); | 3584 | return dssdev->driver->get_mirror(dssdev); |
3585 | } | 3585 | } |
3586 | 3586 | ||
3587 | static int dsi_display_memory_read(struct omap_dss_device *dssdev, | ||
3588 | void *buf, size_t size, | ||
3589 | u16 x, u16 y, u16 w, u16 h) | ||
3590 | { | ||
3591 | int r; | ||
3592 | |||
3593 | DSSDBGF(""); | ||
3594 | |||
3595 | if (!dssdev->driver->memory_read) | ||
3596 | return -EINVAL; | ||
3597 | |||
3598 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
3599 | return -EIO; | ||
3600 | |||
3601 | dsi_bus_lock(); | ||
3602 | |||
3603 | r = dssdev->driver->memory_read(dssdev, buf, size, | ||
3604 | x, y, w, h); | ||
3605 | |||
3606 | /* Memory read usually changes the update area. This will | ||
3607 | * force the next update to re-set the update area */ | ||
3608 | dsi.active_update_region.dirty = true; | ||
3609 | |||
3610 | dsi_bus_unlock(); | ||
3611 | |||
3612 | return r; | ||
3613 | } | ||
3614 | |||
3615 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, | 3587 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, |
3616 | u32 fifo_size, enum omap_burst_size *burst_size, | 3588 | u32 fifo_size, enum omap_burst_size *burst_size, |
3617 | u32 *fifo_low, u32 *fifo_high) | 3589 | u32 *fifo_low, u32 *fifo_high) |
@@ -3646,8 +3618,6 @@ int dsi_init_display(struct omap_dss_device *dssdev) | |||
3646 | dssdev->get_mirror = dsi_display_get_mirror; | 3618 | dssdev->get_mirror = dsi_display_get_mirror; |
3647 | dssdev->set_mirror = dsi_display_set_mirror; | 3619 | dssdev->set_mirror = dsi_display_set_mirror; |
3648 | 3620 | ||
3649 | dssdev->memory_read = dsi_display_memory_read; | ||
3650 | |||
3651 | /* XXX these should be figured out dynamically */ | 3621 | /* XXX these should be figured out dynamically */ |
3652 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | | 3622 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | |
3653 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; | 3623 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; |
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index 6dc9b5c587a5..6e0186edc7da 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c | |||
@@ -374,7 +374,7 @@ static int omapfb_memory_read(struct fb_info *fbi, | |||
374 | void *buf; | 374 | void *buf; |
375 | int r; | 375 | int r; |
376 | 376 | ||
377 | if (!display || !display->memory_read) | 377 | if (!display || !display->driver->memory_read) |
378 | return -ENOENT; | 378 | return -ENOENT; |
379 | 379 | ||
380 | if (!access_ok(VERIFY_WRITE, mr->buffer, mr->buffer_size)) | 380 | if (!access_ok(VERIFY_WRITE, mr->buffer, mr->buffer_size)) |
@@ -389,7 +389,7 @@ static int omapfb_memory_read(struct fb_info *fbi, | |||
389 | return -ENOMEM; | 389 | return -ENOMEM; |
390 | } | 390 | } |
391 | 391 | ||
392 | r = display->memory_read(display, buf, mr->buffer_size, | 392 | r = display->driver->memory_read(display, buf, mr->buffer_size, |
393 | mr->x, mr->y, mr->w, mr->h); | 393 | mr->x, mr->y, mr->w, mr->h); |
394 | 394 | ||
395 | if (r > 0) { | 395 | if (r > 0) { |