-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more functionality to the API #65
Conversation
…om fbdepth with some modification.
I'll have more time this week-end, so, very, very quick comments:
|
Then again, the rota/bitdepth stuff isn't really supported on PB (as it's even quirkier than on Kobo), and the only things one could really have missed were indeed Plus, I really like the |
I agree it's not really nesassary to expose vInfo & fInfo right now (except for the color format in vinfo but let's just ignore that). |
I am not sure how to mark the exported pointer as const tho as it has to be written somewhere if it is passed as an argument. |
I was vaguely thinking of something along the lines of EDIT: Can't const rvalues anyway, brain is fried ^^. The only way I can think of to return a const something would be with an unwieldier double pointer with something like an TL;DR: I'll sleep on it some more. Not super fond of the brand new struct for this, but I don't hate it either, hence the proposed signature above. And I do like keeping this separate and those two together (so, no moving alloc_size to FBInkState). |
As far as set_fbinfo is concerned (don't mind the names I'm using here, writing this quickly without actual reference, and nothing's set in stone ;p), I'd move it to fbink_rota_quirks.c. As for its actual code, I've got a few quick notes jotted down, but I'll probably simply handle some minor cleanup post-merge myself, as the API looks fine ;). I do like the sunxi shortcut for rota, I hadn't quite thought it through yet, and my original plan was simply to throw an ENOTSUP on sunxi, but this is much better, and actually makes sense ;p. EDIT: I would possibly just move (FWIW, part of the stuff I jotted down involves making the magic "don't change me" values actual defines to make that clearer in the API docs). |
Thanks! |
These are my proposed changes for the FBInk API.
Some new members to the FBInkState struct:
uint8_t current_rota_native; // native screen rotaiton; vInfo.rotate (current rotation, c.f., <linux/fb.h>)uint8_t current_rota_canonical; // canonical screen rotation
uint32_t screen_stride; // screen line length in bytes;
A new method to access the underlying framebuffer:
// Grants direct access to the frame buffer pointer as well as the size of the frame buffer allocation.
// If the framebuffer is not yet allocated it will do so and return the result of the operation.
FBINK_API int
fbink_get_fb_pointer(int fbfd, FBPtrInfo *fbInfo);
A new method to set the framebuffer rotation and bpp.
The code is mostly copied from fbdepth and probably needs some tinkering:
// Sets the framebuffer bits per pixel and rotation and invoke a reinit afterwards
// rota will be the rotation in natve format; use fbink_rota_canonical_to_native to convert it to canonical
// bpp will remain unchanged if the value is < 8
// req_gray will remain unchanged if the value is < 0
// on sunxi devices it will invoke fbink_sunxi_ntx_enforce_rota
FBINK_API int
fbink_set_fb_info(int fbFd, int32_t bpp, int8_t rota, int32_t req_gray,
const FBInkConfig* restrict fbink_cfg);
This change is