[media] omap3isp: preview: Optimize parameters setup for the common case
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 26 Mar 2012 13:24:50 +0000 (10:24 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 8 May 2012 16:52:33 +0000 (13:52 -0300)
If no parameter needs to be modified, make preview_config() and
preview_setup_hw() return immediately. This speeds up interrupt handling
in the common case.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/omap3isp/isppreview.c

index cf5014f2302d110df2bc45e9a4aec2078fd6524d..04c96899f005d56bf3b0953a20326c04ea317713 100644 (file)
@@ -889,6 +889,9 @@ static int preview_config(struct isp_prev_device *prev,
        struct preview_update *attr;
        int i, bit, rval = 0;
 
+       if (cfg->update == 0)
+               return 0;
+
        params = &prev->params;
 
        if (prev->state != ISP_PIPELINE_STREAM_STOPPED) {
@@ -944,6 +947,9 @@ static void preview_setup_hw(struct isp_prev_device *prev)
        int i, bit;
        void *param_ptr;
 
+       if (prev->update == 0)
+               return;
+
        for (i = 0; i < ARRAY_SIZE(update_attrs); i++) {
                attr = &update_attrs[i];