-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Take in framebuffer resolution, not output res #7922
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
Conversation
I ran this on the Adafruit Feather RP2040 dvi and it seemed to work fine. I displayed a gif from I was hoping I might stumble on a clue as to why the DVI+PicoW build is giving me trouble but other than learning that a color depth of 1 requires a widthxheight of 640x480 and a color depth of 8 requires 320x240 when creating a picodvi.framebuffer (either in C or python) I don't think I'm any closer. |
I tested all the combo I had in mind with the artifact for the Feather RP2040 DVI from this PR, and I get the result in the code comment. I am not super fan of the error "# ValueError: Invalid width" but at least those 3 give the same value: Regards
|
@dglaude Would |
Ok, this should be ready for review. Thanks for the testing! It'll raise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested with more or less @dglaude's code above, and got what I expected
It's a bit weird to me that 320x240 with a color depth of 1 or 2 doesn't work, but I guess that's the way it is.
We could implement it but PicoDVI doesn't by default. |
I also tested with the above code and it worked as expected. I did notice one peculiarity, If you set the framebuffer to any of the sizes greater than 320x240, pressing ctrl-D and then attempting to run the code with another framebuffer size greater than 320x240 but different than the one you just used caused a memory error. Pressing ctrl-D again, after getting the memory error and pasting in the same code that just gave you the error then succeeds. |
I saw the memory errors too, but I thought it was because the buffer was deliberately persistent across VM's. |
There did seem to be some correlation with the persistence of the DVI output across Ctrl-D restarts but I didn't do it enough times to figure out the relationship. I was changing framebuffer sizes most times and it didn't seem like the DVI output survived most ctrl-D restarts but it did sometimes..... |
I am fine with "Invalid color_depth" or anything, really. I had the same memory issue (I guess)... this is why I have that count-down. I did not try to understand the random memory allocation issue... could it be that the REPL use the DVI output and block reuse? I don't know much how ^D interact with memory management. I was thinking the allocation error were due to some fragmentation, assuming some stuff stay allocated and block big allocation? Is this memory thing a blocker for this PR? My guess is that it was the same behavior as before the PR and unrelated to making x and y more easy to understand. |
I think the memory issue does have to do with the buffer outside the VM heap vs inside. I don't know of a good way to fix it. |
Fixes #7911