linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kris Karas (Bug reporting)" <bugs-a21@moonlit-rail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	Javier Martinez Canillas <javierm@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Linux Fbdev development list <linux-fbdev@vger.kernel.org>
Subject: Re: [PATCH 1/2] video: vga16fb: Fix logic that checks for the display standard
Date: Sun, 9 Jan 2022 15:20:07 -0500	[thread overview]
Message-ID: <4fac9803-50d2-0c83-8b49-a1b2058d7da0@moonlit-rail.com> (raw)
In-Reply-To: <CAMuHMdXG3xOUrzOoRQVgpb4MmuQKJ1y3yPXv=p4AiNEohrzZug@mail.gmail.com>

Groetje, Geert,

Geert Uytterhoeven wrote:
>
>> -       par->isVGA = screen_info.orig_video_isVGA;
>> +       par->isVGA = screen_info.orig_video_isVGA == VIDEO_TYPE_VGAC;
> All non-x86 architectures (except for 2 MIPS platforms) treat
> orig_video_isVGA as a boolean flag, and just assign 1 to it.
> Hence this change would break them.

I see a bit of a conflict with using orig_video_isVGA as a boolean. All 
the modern architecture-agnostic driver code, such as sysfb, 
sysfb_simplefb, and efifb, all use and expect orig_video_isVGA to be an 
integer.  On the other hand, the VGA driver for XEN first sets 
orig_video_isVGA  = 1 (boolean), and then VIDEO_TYPE_VLFB or 
VIDEO_TYPE_EFI (integer).  Overloading the definition for 
orig_video_isVGA to be both boolean and integer - within the same file - 
seems like a recipe for bugs to me.

That said, I think that wrapping the par->isVGA code, above, within a 
check for CONFIG_X86 seems safe and expedient.  But I would be much 
happier if the non-x86 architectures would set it to a proper integer 
value (even if fake) that coincidentally satisfies boolean "true", say 
VIDEO_TYPE_VGAC; that way, there would be no confusion as to data type 
in all the more recent architecture-agnostic framebuffer code.

Kris

  reply	other threads:[~2022-01-09 20:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07 11:07 [PATCH 0/2] video: A couple of fixes for the vga16fb driver Javier Martinez Canillas
2022-01-07 11:07 ` [PATCH 1/2] video: vga16fb: Fix logic that checks for the display standard Javier Martinez Canillas
2022-01-09 10:02   ` Geert Uytterhoeven
2022-01-09 20:20     ` Kris Karas (Bug reporting) [this message]
2022-01-10  8:22       ` Javier Martinez Canillas
2022-01-07 11:07 ` [PATCH 2/2] video: vga16fb: Only probe for EGA and VGA 16 color graphic cards Javier Martinez Canillas
2022-01-09 10:01   ` Geert Uytterhoeven

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=4fac9803-50d2-0c83-8b49-a1b2058d7da0@moonlit-rail.com \
    --to=bugs-a21@moonlit-rail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=javierm@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).