Loading openbsd_drm_howto.tex +25 −9 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ %opening \title{OpenBSD DRM/KMS driver implementation guide} \author{Léo Grange} \author{Léo Grange \\ \href{mailto:grangeleo@gmail.com}{grangeleo@gmail.com}} \bibliographystyle{plain} Loading Loading @@ -41,12 +41,22 @@ I could do, I will try to give you as much reference as possible, and to fill th holes I encountered myself. As explaining abstract things with a concrete example often helps to understand, we will use the OpenBSD Cirrus DRM driver for illustration purpose. The old Cirrus chipsets are significantly easier to program than their today's equivalents (Intel or AMD/ATI cards). we will use the OpenBSD Cirrus DRM driver\footnotemark for illustration purpose. This driver was originally written as part of a Google Summer of Code 2015 project, to provide an understandable basis for future DRM drivers. Indeed, the old Cirrus chipsets are significantly easier to program than their today's equivalents (Intel or AMD/ATI cards). In addition, the Cirrus CL-GD5446 card is well emulated in QEMU, which makes it easier to test the driver and to experiment with it. % talk about Cirrus driver \footnotetext{ Until \texttt{cirrusdrm} driver integration to upstream OpenBSD, a version of the driver is available through a git repository, at \url{http://lab.knightsofnii.com/kristaba/openbsd.git}, on the branch \texttt{cirrusdrm-current}. A web interface is also provided at \url{http://lab.knightsofnii.com/kristaba/openbsd/tree/cirrusdrm-current/sys/dev/pci/drm/cirrus}. } \end{abstract} Loading Loading @@ -83,7 +93,7 @@ vice versa. % TODO explain the need of userland X.Org drivers \subsection{Userland API} %\subsection{Userland API} % TODO \subsection{Kernel driver model} Loading Loading @@ -187,10 +197,16 @@ Despite the relatively well furnished documentation available on the DRM interna APIs, it's difficult to create a new driver without some examples. The example used here is \texttt{cirrusdrm}, a pretty simple driver which supports mainly the Cirrus CL-GD5446 chipset. This driver was written from scratch, based on \texttt{radeon} and \texttt{i915} DRM driver sources as well as the X.org DDX driver \texttt{xf86-video-cirrus}. A similar driver, designed to work only with the QEMU and Xen implementations of this chipset, exists in upstream Linux kernel for a while. Unfortunately, the GPL-only license of the driver prevents it to be ported to OpenBSD's kernel, and its authors didn't seem to agree for changing the license. As explained above, this chipset has the huge advantage to be emulated in some virtual machines and hypervisors (QEMU or Xen for example), resulting in an ease virtual machines and hypervisors (QEMU or Xen for instance), resulting in an ease of testing and experimenting with it. As it's a graphics card from the 90's, it has the other advantage to expose a pretty simple hardware, with only one CRTC, a single VGA connector and little acceleration capability. Loading Loading @@ -1034,7 +1050,7 @@ gives an approximation of the connector helper \texttt{.mode\_valid}. Some modes are invalidated later, both in X.org and KMS drivers, for instance when memory is insufficient for a mode. \pagebreak \bibliography{openbsd-biblio} Loading Loading
openbsd_drm_howto.tex +25 −9 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ %opening \title{OpenBSD DRM/KMS driver implementation guide} \author{Léo Grange} \author{Léo Grange \\ \href{mailto:grangeleo@gmail.com}{grangeleo@gmail.com}} \bibliographystyle{plain} Loading Loading @@ -41,12 +41,22 @@ I could do, I will try to give you as much reference as possible, and to fill th holes I encountered myself. As explaining abstract things with a concrete example often helps to understand, we will use the OpenBSD Cirrus DRM driver for illustration purpose. The old Cirrus chipsets are significantly easier to program than their today's equivalents (Intel or AMD/ATI cards). we will use the OpenBSD Cirrus DRM driver\footnotemark for illustration purpose. This driver was originally written as part of a Google Summer of Code 2015 project, to provide an understandable basis for future DRM drivers. Indeed, the old Cirrus chipsets are significantly easier to program than their today's equivalents (Intel or AMD/ATI cards). In addition, the Cirrus CL-GD5446 card is well emulated in QEMU, which makes it easier to test the driver and to experiment with it. % talk about Cirrus driver \footnotetext{ Until \texttt{cirrusdrm} driver integration to upstream OpenBSD, a version of the driver is available through a git repository, at \url{http://lab.knightsofnii.com/kristaba/openbsd.git}, on the branch \texttt{cirrusdrm-current}. A web interface is also provided at \url{http://lab.knightsofnii.com/kristaba/openbsd/tree/cirrusdrm-current/sys/dev/pci/drm/cirrus}. } \end{abstract} Loading Loading @@ -83,7 +93,7 @@ vice versa. % TODO explain the need of userland X.Org drivers \subsection{Userland API} %\subsection{Userland API} % TODO \subsection{Kernel driver model} Loading Loading @@ -187,10 +197,16 @@ Despite the relatively well furnished documentation available on the DRM interna APIs, it's difficult to create a new driver without some examples. The example used here is \texttt{cirrusdrm}, a pretty simple driver which supports mainly the Cirrus CL-GD5446 chipset. This driver was written from scratch, based on \texttt{radeon} and \texttt{i915} DRM driver sources as well as the X.org DDX driver \texttt{xf86-video-cirrus}. A similar driver, designed to work only with the QEMU and Xen implementations of this chipset, exists in upstream Linux kernel for a while. Unfortunately, the GPL-only license of the driver prevents it to be ported to OpenBSD's kernel, and its authors didn't seem to agree for changing the license. As explained above, this chipset has the huge advantage to be emulated in some virtual machines and hypervisors (QEMU or Xen for example), resulting in an ease virtual machines and hypervisors (QEMU or Xen for instance), resulting in an ease of testing and experimenting with it. As it's a graphics card from the 90's, it has the other advantage to expose a pretty simple hardware, with only one CRTC, a single VGA connector and little acceleration capability. Loading Loading @@ -1034,7 +1050,7 @@ gives an approximation of the connector helper \texttt{.mode\_valid}. Some modes are invalidated later, both in X.org and KMS drivers, for instance when memory is insufficient for a mode. \pagebreak \bibliography{openbsd-biblio} Loading