.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "X11::Protocol::Ext::XFree86_DGA 3pm" .TH X11::Protocol::Ext::XFree86_DGA 3pm "2019-08-26" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" X11::Protocol::Ext::XFree86_DGA \- direct video memory access .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& use X11::Protocol; \& my $X = X11::Protocol\->new; \& $X\->init_extension(\*(AqXFree86\-DGA\*(Aq) \& or print "XFree86\-DGA extension not available"; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The XFree86\-DGA extension provides direct access to the video \s-1RAM\s0 of the server display. A client program running on the same machine can use this to read or write directly instead of going through the X protocol. .PP Accessing video memory will require some system-dependent trickery. Under the Linux kernel for example video \s-1RAM\s0 is part of the \fI/dev/mem\fR physical address space and can be brought into program address space with an \&\f(CW\*(C`mmap()\*(C'\fR or accessed with \f(CW\*(C`sysread()\*(C'\fR and \f(CW\*(C`syswrite()\*(C'\fR. This normally requires root permissions. .PP The requests offered here are only XFree86\-DGA version 1.0 as yet and they don't say anything about the pixel layout etc in the memory \*(-- that has to be divined separately. (Version 2.0 has more for that.) .SH "REQUESTS" .IX Header "REQUESTS" The following requests are made available with an \f(CW\*(C`init_extension()\*(C'\fR, as per \*(L"\s-1EXTENSIONS\*(R"\s0 in X11::Protocol. .PP .Vb 1 \& my $ext_available = $X\->init_extension(\*(AqXFree86\-DGA\*(Aq); .Ve .SS "XFree86\-DGA 1.0" .IX Subsection "XFree86-DGA 1.0" .ie n .IP """($server_major, $server_minor) = $X\->XF86DGAQueryVersion()""" 4 .el .IP "\f(CW($server_major, $server_minor) = $X\->XF86DGAQueryVersion()\fR" 4 .IX Item "($server_major, $server_minor) = $X->XF86DGAQueryVersion()" Return the \s-1DGA\s0 protocol version implemented by the server. .ie n .IP """$flags = $X\->XF86DGAQueryDirectVideo ($screen_num)""" 4 .el .IP "\f(CW$flags = $X\->XF86DGAQueryDirectVideo ($screen_num)\fR" 4 .IX Item "$flags = $X->XF86DGAQueryDirectVideo ($screen_num)" Get flags describing direct video access on \f(CW$screen_num\fR (integer 0 upwards). The only flag bit is .Sp .Vb 1 \& 0x0001 direct video available .Ve .Sp It's possible to have the extension available but no direct video on a particular screen, or even on no screens at all. When no direct video the requests below give protocol error \f(CW\*(C`XF86DGANoDirectVideoMode\*(C'\fR. .ie n .IP """($address, $width, $bank_size_bytes, $ram_size_kbytes) = $X\->XF86DGAGetVideoLL ($screen_num)""" 4 .el .IP "\f(CW($address, $width, $bank_size_bytes, $ram_size_kbytes) = $X\->XF86DGAGetVideoLL ($screen_num)\fR" 4 .IX Item "($address, $width, $bank_size_bytes, $ram_size_kbytes) = $X->XF86DGAGetVideoLL ($screen_num)" Return the location and size of the video memory for \f(CW$screen_num\fR (integer 0 upwards). .Sp \&\f(CW$address\fR is a raw physical 32\-bit address as an integer. \f(CW$width\fR is in pixels. .Sp \&\f(CW$bank_size_bytes\fR is the size in bytes accessible at a given time. \&\f(CW$ram_size_kbytes\fR is the total memory in 1024 byte blocks. If \&\f(CW\*(C`$ram_size_kbytes*1024\*(C'\fR is bigger than \f(CW$bank_size_bytes\fR then \&\f(CW\*(C`$X\->XF86DGASetVidPage()\*(C'\fR below must be used to switch among the banks to access all the \s-1RAM.\s0 .ie n .IP """$X\->XF86DGADirectVideo ($screen_num, $flags)""" 4 .el .IP "\f(CW$X\->XF86DGADirectVideo ($screen_num, $flags)\fR" 4 .IX Item "$X->XF86DGADirectVideo ($screen_num, $flags)" Enable or disable direct video access on \f(CW$screen_num\fR (integer 0 upwards). \&\f(CW$flags\fR is bits .Sp .Vb 3 \& 0x0002 enable direct video graphics \& 0x0004 enable mouse pointer reporting as relative \& 0x0008 enable direct keyboard event reporting .Ve .Sp When direct video graphics is enabled (bit 0x0002) the server gives up control to the client program. .Sp If the graphics card doesn't have a direct video mode then an \&\f(CW\*(C`XF86DGANoDirectVideoMode\*(C'\fR error results, or if the screen is not active (eg. switched away to a different virtual terminal) then \&\f(CW\*(C`XF86DGAScreenNotActive\*(C'\fR. .ie n .IP """($width, $height) = $X\->XF86DGAGetViewPortSize ($screen_num)""" 4 .el .IP "\f(CW($width, $height) = $X\->XF86DGAGetViewPortSize ($screen_num)\fR" 4 .IX Item "($width, $height) = $X->XF86DGAGetViewPortSize ($screen_num)" Get the size of the viewport on \f(CW$screen_num\fR (integer 0 upwards). This is the part of the video memory actually visible on the monitor. The memory might be bigger than the monitor. .ie n .IP """$X\->XF86DGASetViewPort ($screen_num, $x, $y)""" 4 .el .IP "\f(CW$X\->XF86DGASetViewPort ($screen_num, $x, $y)\fR" 4 .IX Item "$X->XF86DGASetViewPort ($screen_num, $x, $y)" Set the coordinates of the top-left corner of the visible part of the video memory on \f(CW$screen_num\fR (integer 0 upwards). .Sp This can be used when the video memory is bigger than the monitor to pan around that bigger area. It can also be used for some double-buffering to display one part of memory while drawing to another. .ie n .IP """$vidpage = $X\->XF86DGAGetVidPage ($screen_num)""" 4 .el .IP "\f(CW$vidpage = $X\->XF86DGAGetVidPage ($screen_num)\fR" 4 .IX Item "$vidpage = $X->XF86DGAGetVidPage ($screen_num)" .PD 0 .ie n .IP """$X\->XF86DGASetVidPage ($screen_num, $vidpage)""" 4 .el .IP "\f(CW$X\->XF86DGASetVidPage ($screen_num, $vidpage)\fR" 4 .IX Item "$X->XF86DGASetVidPage ($screen_num, $vidpage)" .PD Get or set the video page (bank) on \f(CW$screen_num\fR (integer 0 upwards). \&\f(CW$vidpage\fR is an integer 0 upwards. .Sp This is used to access all the \s-1RAM\s0 when when the bank size is less than the total memory size (per \f(CW\*(C`XF86DGAGetVideoLL()\*(C'\fR above). .ie n .IP """$vidpage = $X\->XF86DGAInstallColormap ($screen_num, $colormap)""" 4 .el .IP "\f(CW$vidpage = $X\->XF86DGAInstallColormap ($screen_num, $colormap)\fR" 4 .IX Item "$vidpage = $X->XF86DGAInstallColormap ($screen_num, $colormap)" Set the colormap on \f(CW$screen_num\fR to \f(CW$colormap\fR (integer \s-1XID\s0). .Sp This can only be used while direct video is enabled (per \&\f(CW\*(C`XF86DGADirectVideo()\*(C'\fR above) or an error \f(CW\*(C`XF86DGAScreenNotActive\*(C'\fR or \&\f(CW\*(C`XF86DGADirectNotActivated\*(C'\fR results. .ie n .IP """$bool = $X\->XF86DGAViewPortChanged ($screen_num, $num_pages)""" 4 .el .IP "\f(CW$bool = $X\->XF86DGAViewPortChanged ($screen_num, $num_pages)\fR" 4 .IX Item "$bool = $X->XF86DGAViewPortChanged ($screen_num, $num_pages)" Check whether a previous \f(CW\*(C`XF86DGASetViewPort()\*(C'\fR on \f(CW$screen_num\fR (integer 0 upwards) has completed, meaning a vertical retrace has occurred since that viewport location was set. .Sp This is used for double-buffering (or N\-multi-buffering) to check a viewport change has become visible. \f(CW$num_pages\fR should be 2 for double-buffering and can be higher for multi-buffering. .SH "SEE ALSO" .IX Header "SEE ALSO" X11::Protocol .PP \&\fI/usr/share/doc/xserver\-xfree86/README.DGA.gz\fR .SH "HOME PAGE" .IX Header "HOME PAGE" .SH "LICENSE" .IX Header "LICENSE" Copyright 2011, 2012, 2013, 2014, 2017 Kevin Ryde .PP X11\-Protocol\-Other is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. .PP X11\-Protocol\-Other is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with X11\-Protocol\-Other. If not, see .