staging: bcm2835-camera: Allocate context once per buffer
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Thu, 10 May 2018 19:42:08 +0000 (12:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 May 2018 10:02:05 +0000 (12:02 +0200)
commit96b7e81ab6b74e7cefdac0d7a90b746ef7f8597d
tree62ed9e01ae88efb21de635e3fcfb2115c749c980
parentdd9bb50522733befceac9cbe0b68f5ad4e5106ff
staging: bcm2835-camera: Allocate context once per buffer

The struct mmal_msg_context was being allocated for every message
being sent to the VPU, and freed when it came back.  Whilst that is
required behaviour for some messages (mainly the synchronous ones), it
is wasteful for the video buffers that make up the majority of the
traffic.

Add to the buffer_init/cleanup hooks that it allocates/frees the
msg_context required.

v2: changes by anholt from the downstream tree: clean up indentation,
    pass an error value through, forward-declare the struct so we have
    less void *

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
drivers/staging/vc04_services/bcm2835-camera/mmal-common.h
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h