Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0bfeb04a9f3ad9ad8c9bbba062231ff1a76e4465
Commit:     0bfeb04a9f3ad9ad8c9bbba062231ff1a76e4465
Parent:     d343d7f9792ac1790757cb35a419b8b0b5210917
Author:     Ian Armstrong <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 14 13:08:02 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:01:48 2007 -0200

    V4L/DVB (6345): ivtvfb: YUV handling of an image which is not visible in 
the display area
    
    When the ivtvfb module is loaded, the YUV output is relative to the
    framebuffer output. When a virtual screen size is used, the output area for
    the YUV may actually be off screen. To prevent the hardware from crashing,
    the current driver will ignore an off-screen position and leave the output
    visible at the last on-screen position. This may not be desirable, so this
    patch will switch off the YUV output should the image move off-screen, and
    re-enable it should the image move on-screen again.
    
    Signed-off-by: Ian Armstrong <[EMAIL PROTECTED]>
    Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/ivtv/ivtv-yuv.c |   22 ++++++++++++----------
 drivers/media/video/ivtv/ivtv-yuv.h |    1 +
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-yuv.c 
b/drivers/media/video/ivtv/ivtv-yuv.c
index e2288f2..13c3582 100644
--- a/drivers/media/video/ivtv/ivtv-yuv.c
+++ b/drivers/media/video/ivtv/ivtv-yuv.c
@@ -710,7 +710,7 @@ static u32 ivtv_yuv_window_setup (struct ivtv *itv, struct 
yuv_frame_info *windo
 
        /* If there's nothing to safe to display, we may as well stop now */
        if ((int)window->dst_w <= 2 || (int)window->dst_h <= 2 || 
(int)window->src_w <= 2 || (int)window->src_h <= 2) {
-               return 0;
+               return IVTV_YUV_UPDATE_INVALID;
        }
 
        /* Ensure video remains inside OSD area */
@@ -791,7 +791,7 @@ static u32 ivtv_yuv_window_setup (struct ivtv *itv, struct 
yuv_frame_info *windo
 
        /* Check again. If there's nothing to safe to display, stop now */
        if ((int)window->dst_w <= 2 || (int)window->dst_h <= 2 || 
(int)window->src_w <= 2 || (int)window->src_h <= 2) {
-               return 0;
+               return IVTV_YUV_UPDATE_INVALID;
        }
 
        /* Both x offset & width are linked, so they have to be done together */
@@ -840,12 +840,17 @@ void ivtv_yuv_work_handler (struct ivtv *itv)
        if (!(yuv_update = ivtv_yuv_window_setup (itv, &window)))
                return;
 
-       /* Update horizontal settings */
-       if (yuv_update & IVTV_YUV_UPDATE_HORIZONTAL)
-               ivtv_yuv_handle_horizontal(itv, &window);
+       if (yuv_update & IVTV_YUV_UPDATE_INVALID) {
+               write_reg(0x01008080, 0x2898);
+       } else if (yuv_update) {
+               write_reg(0x00108080, 0x2898);
 
-       if (yuv_update & IVTV_YUV_UPDATE_VERTICAL)
-               ivtv_yuv_handle_vertical(itv, &window);
+               if (yuv_update & IVTV_YUV_UPDATE_HORIZONTAL)
+                       ivtv_yuv_handle_horizontal(itv, &window);
+
+               if (yuv_update & IVTV_YUV_UPDATE_VERTICAL)
+                       ivtv_yuv_handle_vertical(itv, &window);
+       }
 
        memcpy(&itv->yuv_info.old_frame_info, &window, sizeof 
(itv->yuv_info.old_frame_info));
 }
@@ -936,9 +941,6 @@ static void ivtv_yuv_init (struct ivtv *itv)
                IVTV_DEBUG_WARN ("Failed to allocate yuv blanking buffer\n");
        }
 
-       IVTV_DEBUG_WARN("Enable video output\n");
-       write_reg_sync(0x00108080, 0x2898);
-
        /* Enable YUV decoder output */
        write_reg_sync(0x01, IVTV_REG_VDM);
 
diff --git a/drivers/media/video/ivtv/ivtv-yuv.h 
b/drivers/media/video/ivtv/ivtv-yuv.h
index f7215ee..3b966f0 100644
--- a/drivers/media/video/ivtv/ivtv-yuv.h
+++ b/drivers/media/video/ivtv/ivtv-yuv.h
@@ -34,6 +34,7 @@
 
 #define IVTV_YUV_UPDATE_HORIZONTAL  0x01
 #define IVTV_YUV_UPDATE_VERTICAL    0x02
+#define IVTV_YUV_UPDATE_INVALID     0x04
 
 extern const u32 yuv_offset[4];
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to