Skip to content

Commit 3d99bfb

Browse files
committed
kernel/libs: VCHIQ: Make service closure fully synchronous
With these patches, calls to vchiq_close_service and vchiq_remove_service won't return until any associated callbacks have been delivered to the callback thread. firmware: video_render: Add parameter for setting the colourspace Only applicable for non-opaque buffers firmware: gpioman: Allow oscillator to be selected as a clock source firmware: image_decode: huffman and quantization tables shouldn't trigger 'keep all following' See: http://forum.stmlabs.com/showthread.php?tid=14839 userland: hello_jpeg: Fix decode fail when width/height can't be parsed from first 80K block firmware: video_render: Fix for stereo rendering when crop height is not populated
1 parent e388505 commit 3d99bfb

31 files changed

+31
-23
lines changed

fixup.dat

-5 Bytes
Binary file not shown.

fixup_cd.dat

-3 Bytes
Binary file not shown.

fixup_x.dat

-7 Bytes
Binary file not shown.

git_hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4ab8abbf53c043a84a6e64a1fa1f6e173ba1c168
1+
f03cd5e1012d3fe8314a944879308cf0f3d9e29b

kernel.img

-304 Bytes
Binary file not shown.

start.elf

256 Bytes
Binary file not shown.

start_cd.elf

-64 Bytes
Binary file not shown.

start_x.elf

288 Bytes
Binary file not shown.

vc/hardfp/opt/vc/bin/vchiq_test

495 Bytes
Binary file not shown.

vc/hardfp/opt/vc/lib/libEGL_static.a

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

vc/hardfp/opt/vc/lib/libkhrn_client.a

0 Bytes
Binary file not shown.

vc/hardfp/opt/vc/lib/libkhrn_static.a

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

vc/hardfp/opt/vc/lib/libvchiq_arm.so

0 Bytes
Binary file not shown.

vc/hardfp/opt/vc/lib/libvchostif.a

0 Bytes
Binary file not shown.

vc/hardfp/opt/vc/lib/libvcilcs.a

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

vc/sdk/opt/vc/include/interface/vchiq_arm/vchiq_cfg.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2012, Broadcom Europe Ltd
2+
Copyright (c) 2014, Broadcom Europe Ltd
33
All rights reserved.
44
55
Redistribution and use in source and binary forms, with or without
@@ -30,11 +30,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030

3131
#define VCHIQ_MAGIC VCHIQ_MAKE_FOURCC('V', 'C', 'H', 'I')
3232
/* The version of VCHIQ - change with any non-trivial change */
33-
#define VCHIQ_VERSION 6
33+
#define VCHIQ_VERSION 7
3434
/* The minimum compatible version - update to match VCHIQ_VERSION with any
3535
** incompatible change */
3636
#define VCHIQ_VERSION_MIN 3
3737

38+
/* The version that introduced the VCHIQ_IOC_LIB_VERSION ioctl */
39+
#define VCHIQ_VERSION_LIB_VERSION 7
40+
41+
/* The version that introduced the VCHIQ_IOC_CLOSE_DELIVERED ioctl */
42+
#define VCHIQ_VERSION_CLOSE_DELIVERED 7
43+
3844
#define VCHIQ_MAX_STATES 2
3945
#define VCHIQ_MAX_SERVICES 4096
4046
#define VCHIQ_MAX_SLOTS 128

vc/sdk/opt/vc/include/interface/vchiq_arm/vchiq_ioctl.h

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232
#include "vchiq_if.h"
3333

3434
#define VCHIQ_IOC_MAGIC 0xc4
35-
#define VCHIQ_INVALID_HANDLE -1
35+
#define VCHIQ_INVALID_HANDLE (~0)
3636

3737
typedef struct {
3838
VCHIQ_SERVICE_PARAMS_T params;
3939
int is_open;
4040
int is_vchi;
41-
int handle; /* OUT */
41+
unsigned int handle; /* OUT */
4242
} VCHIQ_CREATE_SERVICE_T;
4343

4444
typedef struct {
45-
int handle;
46-
int count;
45+
unsigned int handle;
46+
unsigned int count;
4747
const VCHIQ_ELEMENT_T *elements;
4848
} VCHIQ_QUEUE_MESSAGE_T;
4949

5050
typedef struct {
51-
int handle;
51+
unsigned int handle;
5252
void *data;
53-
int size;
53+
unsigned int size;
5454
void *userdata;
5555
VCHIQ_BULK_MODE_T mode;
5656
} VCHIQ_QUEUE_BULK_TRANSFER_T;
@@ -63,27 +63,27 @@ typedef struct {
6363
} VCHIQ_COMPLETION_DATA_T;
6464

6565
typedef struct {
66-
int count;
66+
unsigned int count;
6767
VCHIQ_COMPLETION_DATA_T *buf;
68-
int msgbufsize;
69-
int msgbufcount; /* IN/OUT */
68+
unsigned int msgbufsize;
69+
unsigned int msgbufcount; /* IN/OUT */
7070
void **msgbufs;
7171
} VCHIQ_AWAIT_COMPLETION_T;
7272

7373
typedef struct {
74-
int handle;
74+
unsigned int handle;
7575
int blocking;
76-
int bufsize;
76+
unsigned int bufsize;
7777
void *buf;
7878
} VCHIQ_DEQUEUE_MESSAGE_T;
7979

8080
typedef struct {
81-
int config_size;
81+
unsigned int config_size;
8282
VCHIQ_CONFIG_T *pconfig;
8383
} VCHIQ_GET_CONFIG_T;
8484

8585
typedef struct {
86-
int handle;
86+
unsigned int handle;
8787
VCHIQ_SERVICE_OPTION_T option;
8888
int value;
8989
} VCHIQ_SET_SERVICE_OPTION_T;
@@ -109,6 +109,8 @@ typedef struct {
109109
#define VCHIQ_IOC_RELEASE_SERVICE _IO(VCHIQ_IOC_MAGIC, 13)
110110
#define VCHIQ_IOC_SET_SERVICE_OPTION _IOW(VCHIQ_IOC_MAGIC, 14, VCHIQ_SET_SERVICE_OPTION_T)
111111
#define VCHIQ_IOC_DUMP_PHYS_MEM _IOW(VCHIQ_IOC_MAGIC, 15, VCHIQ_DUMP_MEM_T)
112-
#define VCHIQ_IOC_MAX 15
112+
#define VCHIQ_IOC_LIB_VERSION _IO(VCHIQ_IOC_MAGIC, 16)
113+
#define VCHIQ_IOC_CLOSE_DELIVERED _IO(VCHIQ_IOC_MAGIC, 17)
114+
#define VCHIQ_IOC_MAX 17
113115

114116
#endif

vc/sdk/opt/vc/src/hello_pi/hello_jpeg/jpeg.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ portSettingsChanged(OPENMAX_JPEG_DECODER * decoder)
184184
portdef.nBufferSize);
185185
if (ret != OMX_ErrorNone) {
186186
perror("Eror allocating buffer");
187+
fprintf(stderr, "OMX_AllocateBuffer returned 0x%x allocating buffer size 0x%x\n", ret, portdef.nBufferSize);
187188
return OMXJPEG_ERROR_MEMORY;
188189
}
189190

@@ -491,7 +492,7 @@ decodeImage(OPENMAX_JPEG_DECODER * decoder, char *sourceImage,
491492
}
492493
// wait for buffer to empty or port changed event
493494
int done = 0;
494-
while ((done == 0) || (decoder->pOutputBufferHeader == NULL)) {
495+
while ((done == 0) && (decoder->pOutputBufferHeader == NULL)) {
495496
if (decoder->pOutputBufferHeader == NULL) {
496497
ret =
497498
ilclient_wait_for_event
@@ -500,7 +501,9 @@ decodeImage(OPENMAX_JPEG_DECODER * decoder, char *sourceImage,
500501
decoder->imageDecoder->outPort, 0, 0, 1, 0, 5);
501502

502503
if (ret == 0) {
503-
portSettingsChanged(decoder);
504+
ret = portSettingsChanged(decoder);
505+
if (ret != OMXJPEG_OK)
506+
return ret;
504507
}
505508
} else {
506509
ret =
@@ -523,10 +526,7 @@ decodeImage(OPENMAX_JPEG_DECODER * decoder, char *sourceImage,
523526
}
524527

525528
// fill the buffer if we have created the buffer
526-
if (bFilled == 0) {
527-
if ((decoder->pOutputBufferHeader == NULL)) {
528-
portSettingsChanged(decoder);
529-
}
529+
if ((bFilled == 0) && (decoder->pOutputBufferHeader != NULL)) {
530530
ret = OMX_FillThisBuffer(decoder->imageResizer->handle,
531531
decoder->pOutputBufferHeader);
532532
if (ret != OMX_ErrorNone) {

vc/softfp/opt/vc/bin/vchiq_test

475 Bytes
Binary file not shown.

vc/softfp/opt/vc/lib/libEGL_static.a

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

vc/softfp/opt/vc/lib/libkhrn_client.a

0 Bytes
Binary file not shown.

vc/softfp/opt/vc/lib/libkhrn_static.a

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

vc/softfp/opt/vc/lib/libvchiq_arm.so

0 Bytes
Binary file not shown.

vc/softfp/opt/vc/lib/libvchostif.a

0 Bytes
Binary file not shown.

vc/softfp/opt/vc/lib/libvcilcs.a

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)