All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: Howto consolidate xgifb (staging) with sisfb
Date: Mon, 19 Mar 2012 23:26:00 +0000	[thread overview]
Message-ID: <20120319232600.GA6386@kroah.com> (raw)
In-Reply-To: <201203200002.40429.PeterHuewe@gmx.de>

On Tue, Mar 20, 2012 at 12:02:39AM +0100, Peter Hüwe wrote:
> Hi,
> 
> I'm currently trying to improve the xgifb driver from staging a bit and my 
> final goal is to probably merge this driver with the sis driver (as both card 
> families seem to have a lot in common).
> 
> However I'm a little bit unsure how to proceed here.
> 
> e.g. the sis and the xgifb driver have some nearly duplicated functions in 
> common, e.g.
> static void XGIfb_bpp_to_var(struct xgifb_video_info *xgifb_info, 			     
> struct fb_var_screeninfo *var)
> http://git.kernel.org/?p=linux/kernel/git/gregkh/staging.git;a=blob;f=drivers/staging/xgifb/XGI_main_26.c;hb=HEAD#l769
> 
> and 
> static void sisfb_bpp_to_var(struct sis_video_info *ivideo, struct 
> fb_var_screeninfo *var)
> http://git.kernel.org/?p=linux/kernel/git/gregkh/staging.git;a=blob;f=drivers/video/sis/sis_main.c;hb=HEAD#l1129
> 
> 
> have the same semantics. (the only difference is the _video_info struct).
> 
> -> Is there a way the xgifb driver can call the function from sis?  (I know 
> it's static and not EXPORT_SYMBOL'ed)

Declare it not static and EXPORT_SYMBOL it :)

> Or how would you prepare the consolidation here ? 
> (e.g. make the functions identical? and when the merge get's done sometime 
> simply remove the duplicate?)

How about moving things to a "library" module that both modules call
with these functions, pulling them from one of the drivers.

> And how would you proceed with functions that are nearly identical (but each 
> function is missing some bits from the other card)
> e.g. 
> static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct 
> fb_info *info)
> http://git.kernel.org/?p=linux/kernel/git/gregkh/staging.git;a=blob;f=drivers/video/sis/sis_main.c;hb=HEAD#l1839
> and 
> static int XGIfb_get_fix(struct fb_fix_screeninfo *fix, int con,  struct 
> fb_info *info)
> http://git.kernel.org/?p=linux/kernel/git/gregkh/staging.git;a=blob;f=drivers/staging/xgifb/XGI_main_26.c;hb=HEAD#l1365
> could be easily merged, but in which direction? Add the new code to directly 
> to sis or 'backport' sis stuff to xgifb? or both (i.e. make them identical 
> like in the first case?)

Whatever you feel is best to do here.

greg k-h

  reply	other threads:[~2012-03-19 23:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19 23:02 Howto consolidate xgifb (staging) with sisfb Peter Hüwe
2012-03-19 23:26 ` Greg KH [this message]
2012-03-20  6:40 ` Thomas Winischhofer
2012-03-20 21:06 ` Aaro Koskinen
2012-03-20 21:40 ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120319232600.GA6386@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-fbdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.