<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
On Mon, 2011-11-14 at 09:13 +0200, Martin-&#201;ric Racine wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
2011/11/14 Marc Balmer &lt;<A HREF="mailto:mbalmer@netbsd.org">mbalmer@netbsd.org</A>&gt;:
&gt; Am 14.11.11 02:10, schrieb Martin-&#201;ric Racine:
&gt;&gt; 2011/11/14 Gaetan Nadon &lt;<A HREF="mailto:memsize@videotron.ca">memsize@videotron.ca</A>&gt;:
&gt;&gt;&gt; On Sun, 2011-11-13 at 23:51 +0200, Martin-&#201;ric Racine wrote:
&gt;&gt;&gt;
&gt;&gt;&gt; It just occured to me that Marc Balmer once contacted the list with an
&gt;&gt;&gt; announce that he was maintaining the OpenBSD port of xf86-video-geode.
&gt;&gt;&gt; Let's see if he can participate in this discussion and provide some of
&gt;&gt;&gt; the answers. Who knows, he might already have a usable diff to provide
&gt;&gt;&gt; us with as a starting point. :)
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; Great.
&gt;&gt;&gt;
&gt;&gt;&gt; <A HREF="http://www.openbsd.org/i386.html#hardware">http://www.openbsd.org/i386.html#hardware</A>
&gt;&gt;&gt;
&gt;&gt;&gt; Geode listed as being supported.
&gt;&gt;&gt;
&gt;&gt;&gt; <A HREF="http://www.openbsd.org/cgi-bin/cvsweb/xenocara/driver/xf86-video-geode/">http://www.openbsd.org/cgi-bin/cvsweb/xenocara/driver/xf86-video-geode/</A>
&gt;&gt;&gt;
&gt;&gt;&gt; I could not really see any code changes having been done.
&gt;&gt;
&gt;&gt; Try the diff to these two, for starters:
&gt;&gt;
&gt;&gt; --- xf86-video-geode/src/Makefile.am
&gt;&gt; +++ OpenBSD/xenocara/driver/xf86-video-geode/src/Makefile.am
&gt;&gt;
&gt;&gt; --- xf86-video-geode/src/geode_msr.c
&gt;&gt; +++ OpenBSD/xenocara/driver/xf86-video-geode/src/geode_msr.c
&gt;&gt;
&gt;&gt; There's also some interesting changes to *_driver.c and to lx_exa.c as
&gt;&gt; well. A worrisome number of #ifdef, rather than
&gt;&gt; autoconf/automake/libtool magic, but it's still a nice start.
&gt;&gt;
&gt;&gt;&gt; on OpenBSD/i386 (32 bit) and not 64 bit which would be OpenBSD/amd64 (Intel
&gt;&gt;&gt; EMT64 is considered a clone of AMD64). If I see this correctly, the OpenBSD
&gt;&gt;&gt; geode driver does not run on 64 bit and therefore would not be of a great
&gt;&gt;&gt; help.
&gt;&gt;
&gt;&gt; It does help us see how OpenBSD dealt with the lack of V4L2 capability
&gt;&gt; and with finding the MSR on their platform, among other things. That's
&gt;&gt; a good start for adding BSD support in general.
&gt;
&gt; What I did to make xf86-video-geode usable on OpenBSD was to write an
&gt; amdmsr(4) driver which handles the MSR access. &nbsp;So the driver is
&gt; different from the Linux variant in how it accesses MSRs, the rest is
&gt; more or less unchanged.
&gt;
&gt; See
&gt;
&gt; <A HREF="http://www.openbsd.org/cgi-bin/man.cgi?query=amdmsr&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html">http://www.openbsd.org/cgi-bin/man.cgi?query=amdmsr&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+Current&amp;arch=i386&amp;format=html</A>
&gt;
&gt; for the manual page, or
&gt;
&gt; <A HREF="http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/arch/i386/i386/amdmsr.c?rev=1.9;content-type=text%2Fplain">http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/arch/i386/i386/amdmsr.c?rev=1.9;content-type=text%2Fplain</A>
&gt;
&gt; for the code.
&gt;
&gt; This way, lseek is not needed to access MSRs.

Marc,

Thank you for your reply.

I'm currently trying to merge all changes performed by non-Linux
distributions into GIT. Ideally, we'd prefer changes to be as
unintrusive as possible i.e. autoconf magic rather than hardcoded
</PRE>
</BLOCKQUOTE>
I had a look at the diff C code, nothing stands up as being able to be handled by autoconf.<BR>
<BR>
I would suggest to Marc that the code using the amdmsr method should be wrapped with something other than __OpenBSD__. This is to separate &quot;OS porting differences&quot; vs &quot;alternate implementation differences&quot;. This amdmsr could very well be used on NetBSD for example.<BR>
<BR>
Something like #ifdef USE_AMDMSR perhaps. In configure.ac we could have a --enable-amdmsr and/or auto-detection. This would leave __OpenBSD__ for strict OS porting issues. This new define could be added in the xorg geode driver now, even if only used a little later.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
#ifdef, but we'll take what we can get our hands on anyhow, just as
long as the changes are properly documented and won't prevent building
on Linux.

Others: FYI, I attached a diff between GIT and what OpenBSD currently
has, for your convenience.

Best Regards,
Martin-&#201;ric
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>