Class SelDCCard
Direct Rendering Manager card management.
Methods
| SelDCCard:GetPrimarySurface () | Returns the surface corresponding to the physical display. |
| SelDCCard:CountAvailableModes () | Return the number of mode available |
| SelDCCard:GetSize (mode_index) | Return the size of the current connector as well as refresh frequency. |
| SelDCCard:Release () | Release a card and free all resources |
| SelDCCard:Open (card) | Initialise a card |
| SelDCCard:OpenFB (card_path, vertical_size) | Initialise a card with framebuffer workaround. |
Methods
- SelDCCard:GetPrimarySurface ()
-
Returns the surface corresponding to the physical display.
CAUTION : Drawing to this surface is directly reflected on the screen
Returns:
-
SelDCSurface
surface
- SelDCCard:CountAvailableModes ()
-
Return the number of mode available
Returns:
-
integer
number of available modes
- SelDCCard:GetSize (mode_index)
-
Return the size of the current connector
as well as refresh frequency.
Parameters:
- mode_index integer If omitted, return the active one
Returns:
- integer width
- integer height
- integer frequency
- SelDCCard:Release ()
- Release a card and free all resources
- SelDCCard:Open (card)
-
Initialise a card
Parameters:
- card string path (if not set /dev/dri/card0)
Returns:
-
SelDCCard
card
Raises:
Fails if KMS is missing (Debian :( :( ) - SelDCCard:OpenFB (card_path, vertical_size)
-
Initialise a card with framebuffer workaround.
Useful if KMS is missing. But need to be compiled with DRMC_WITH_FB set.
Parameters:
- card_path string if not set, default to /dev/fb0
- vertical_size integer (optional, force vertical size, otherwise use its physical one
Returns:
-
SelDCCard
card
Usage:
card,err,msg = SelDCCard.Open() if not card then print("*E* DRM :", err,msg) if SELPLUG_DRMCairo_FBEXTENSION then local fb_fch = "/dev/fb1" if not file_exists(fb_fch) then fb_fch = "/dev/fb0" end card,err,msg = SelDCCard.OpenFB(fb_fch) if not card then print("*E* ".. fb_fch .." :", err,msg) os.exit() else print("*I* ok with Framebuffer") end else os.exit() end end