bcm2835-camera: fix for WORKAROUND to build on arm64 25/161225/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 22 Nov 2017 07:34:49 +0000 (16:34 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 22 Nov 2017 07:41:24 +0000 (16:41 +0900)
The bcm2835-v4l2 module has build error on arm64 because of not
matched struct size and l2 cache function. Fix for WORKAROUND to
build on arm64 with commenting out them.

NOTE: it comments out cache operations and does not check vchiq
message size, so it is not clear to work properly.

Change-Id: Icd3e811cea4311499c3382d5a3bc9a2fbb1ad9f6
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/media/platform/bcm2835/mmal-vchiq.c

index ec2853ba9d4b1b0cd6e07a495a424e15159208e8..b053195263383dc7eca316ecac675e6599d3a492 100644 (file)
@@ -276,9 +276,11 @@ static int bulk_receive(struct vchiq_mmal_instance *instance,
        msg_context->u.bulk.dts = msg->u.buffer_from_host.buffer_header.dts;
        msg_context->u.bulk.pts = msg->u.buffer_from_host.buffer_header.pts;
 
+#ifdef CONFIG_ARM
        // only need to flush L1 cache here, as VCHIQ takes care of the L2
        // cache.
        __cpuc_flush_dcache_area(msg_context->u.bulk.buffer->buffer, rd_len);
+#endif
 
        /* queue the bulk submission */
        vchi_service_use(instance->handle);
@@ -714,7 +716,7 @@ static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance,
        /* payload size must not cause message to exceed max size */
        if (payload_len >
            (MMAL_MSG_MAX_SIZE - sizeof(struct mmal_msg_header))) {
-               pr_err("payload length %d exceeds max:%d\n", payload_len,
+               pr_err("payload length %d exceeds max:%lu\n", payload_len,
                         (MMAL_MSG_MAX_SIZE - sizeof(struct mmal_msg_header)));
                return -EINVAL;
        }
@@ -1873,6 +1875,7 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
         * directly (de)serialised from memory.
         */
 
+#ifdef CONFIG_ARM
        /* ensure the header structure has packed to the correct size */
        BUILD_BUG_ON(sizeof(struct mmal_msg_header) != 24);
 
@@ -1881,6 +1884,7 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
 
        /* mmal port struct is correct size */
        BUILD_BUG_ON(sizeof(struct mmal_port) != 64);
+#endif
 
        /* create a vchi instance */
        status = vchi_initialise(&vchi_instance);