Skip to content

Commit bbbf1fc

Browse files
trevdpopcornmix
authored andcommitted
bcm2708_fb : Implement blanking support using the mailbox property interface
This implementation uses the userspace request style of an array of unsigned 32bit ints rather the vc_msg/vc_msg_tag which is more confusing to work with. vcio.h : Added some extra enums to the vcio.h to improve readability vcio.h : Renamed DEVICE_FILE_NAME to something more appropriate. users of the vcio api will be unaffected by this change as the device node is created manually in userspace
1 parent 3d96840 commit bbbf1fc

2 files changed

Lines changed: 35 additions & 5 deletions

File tree

‎arch/arm/mach-bcm2708/include/mach/vcio.h‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@
3333
#define MBOX_CHAN_PROPERTY 8 /* for use by the property channel */
3434
#define MBOX_CHAN_COUNT 9
3535

36+
enum {
37+
VCMSG_PROCESS_REQUEST = 0x00000000
38+
};
39+
enum {
40+
VCMSG_REQUEST_SUCCESSFUL = 0x80000000,
41+
VCMSG_REQUEST_FAILED = 0x80000001
42+
};
3643
/* Mailbox property tags */
3744
enum {
3845
VCMSG_PROPERTY_END = 0x00000000,
@@ -136,6 +143,6 @@ extern int /*rc*/ bcm_mailbox_property(void *data, int size);
136143
/*
137144
* The name of the device file
138145
*/
139-
#define DEVICE_FILE_NAME "char_dev"
146+
#define DEVICE_FILE_NAME "vcio"
140147

141148
#endif

‎drivers/video/fbdev/bcm2708_fb.c‎

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,36 @@ static int bcm2708_fb_setcolreg(unsigned int regno, unsigned int red,
375375
}
376376
return regno > 255;
377377
}
378-
379378
static int bcm2708_fb_blank(int blank_mode, struct fb_info *info)
380379
{
381-
/*print_debug("bcm2708_fb_blank\n"); */
382-
return -1;
383-
}
380+
s32 result = -1 ;
381+
u32 p[7];
382+
if ( (blank_mode == FB_BLANK_NORMAL) ||
383+
(blank_mode == FB_BLANK_UNBLANK)) {
384+
385+
pr_info("bcm2708_fb_blank blank_mode=%d\n",blank_mode);
386+
387+
388+
p[0] = 28; // size = sizeof u32 * length of p
389+
p[1] = VCMSG_PROCESS_REQUEST; // process request
390+
p[2] = VCMSG_SET_BLANK_SCREEN; // (the tag id)
391+
p[3] = 4; // (size of the response buffer)
392+
p[4] = 4; // (size of the request data)
393+
p[5] = blank_mode;
394+
p[6] = VCMSG_PROPERTY_END; // end tag
395+
396+
bcm_mailbox_property(&p, p[0]);
397+
398+
pr_info("bcm2708_fb_blank returns=%d p[1]=0x%x\n",p[5],p[1]);
399+
400+
if ( p[1] == VCMSG_REQUEST_SUCCESSFUL )
401+
result = 0 ;
402+
403+
}
404+
return result;
384405

406+
407+
}
385408
static void bcm2708_fb_fillrect(struct fb_info *info,
386409
const struct fb_fillrect *rect)
387410
{

0 commit comments

Comments
 (0)