464ec402c520a3369fae28e07fc2e57102a70d2a
[openwrt/staging/ynezz.git] /
1 From b9154d619c0ae2c8636b9bb3f76fe3daa9dc6d8d Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Tue, 22 Jan 2019 12:04:09 +0000
4 Subject: [PATCH] staging: mmal-vchiq: Fix client_component for 64 bit
5 kernel
6
7 The MMAL client_component field is used with the event
8 mechanism to allow the client to identify the component for
9 which the event is generated.
10 The field is only 32bits in size, therefore we can't use a
11 pointer to the component in a 64 bit kernel.
12
13 Component handles are already held in an array per VCHI
14 instance, so use the array index as the client_component handle
15 to avoid having to create a new IDR for this purpose.
16
17 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
18 ---
19 drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
21
22 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
23 +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
24 @@ -460,9 +460,9 @@ buffer_from_host(struct vchiq_mmal_insta
25 static void event_to_host_cb(struct vchiq_mmal_instance *instance,
26 struct mmal_msg *msg, u32 msg_len)
27 {
28 - /* FIXME: Not going to work on 64 bit */
29 + int comp_idx = msg->u.event_to_host.client_component;
30 struct vchiq_mmal_component *component =
31 - (struct vchiq_mmal_component *)msg->u.event_to_host.client_component;
32 + &instance->component[comp_idx];
33 struct vchiq_mmal_port *port = NULL;
34 struct mmal_msg_context *msg_context;
35 u32 port_num = msg->u.event_to_host.port_num;