Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: DRI Development <dri-devel@lists.freedesktop.org>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [Intel-gfx] [PATCH 02/11] drm/gma500: Use drm_aperture_remove_conflicting_pci_framebuffers
Date: Thu, 12 Jan 2023 11:24:13 +0100	[thread overview]
Message-ID: <8a154783-b433-c9b8-bfe5-286dde1258e9@suse.de> (raw)
In-Reply-To: <Y7/Z5dvADG6AspV3@phenom.ffwll.local>


[-- Attachment #1.1: Type: text/plain, Size: 2965 bytes --]

Hi

Am 12.01.23 um 10:59 schrieb Daniel Vetter:
> On Thu, Jan 12, 2023 at 10:04:48AM +0100, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 11.01.23 um 16:41 schrieb Daniel Vetter:
>>> This one nukes all framebuffers, which is a bit much. In reality
>>> gma500 is igpu and never shipped with anything discrete, so there should
>>> not be any difference.
>>>
>>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>>> ---
>>>    drivers/gpu/drm/gma500/psb_drv.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
>>> index cd9c73f5a64a..9b0daf90dc50 100644
>>> --- a/drivers/gpu/drm/gma500/psb_drv.c
>>> +++ b/drivers/gpu/drm/gma500/psb_drv.c
>>> @@ -429,7 +429,7 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>>>    	 * TODO: Refactor psb_driver_load() to map vdc_reg earlier. Then we
>>>    	 *       might be able to read the framebuffer range from the device.
>>>    	 */
>>> -	ret = drm_aperture_remove_framebuffers(true, &driver);
>>> +	ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver);
>>
>> This does not work. The comment just above the changed line explains why.
>> The device uses shared memory similar to other integrated Intel chips. The
>> console is somewhere in a 16 MiB range, which has been stolen by the BIOS
>> from main memory. There's only a 1 MiB memory range on the device to program
>> the device. Unless you want to refactor as described, this call has to cover
>> the whole memory for now.
> 
> Uh. So it's maybe not so pretty, but what if I just call both functions?

That's ways more ugly IMHO.

> That way we get the vga handling through the pci one, and the "make sure
> there's no fb left" through the other one. Plus comment of course.
> 
> Otherwise we'd need to somehow keep the vga stuff in the non-pci paths,
> and that just feels all kinds of wrong to me.

With your patch applied, aperture_detach_devices() does all the work of 
removing. I'd add the following internal functions:

static void aperture_detach_head(bool is_primary)
{
	/*
	 * lengthy comment here
	 */
	if (is_primary)
		sysfb_disable()
}

static void aperture_detach_tail(bool remove_vga)
{
	if (remove_vga) {
		aperture_detach_devices(VGA_PHYS_)
		vga_remove_vgacon()
	}
}

And call both of them at the beginning/end of 
aperture_remove_conflicting_devices() and 
aperture_remove_conflicting_pci_devices().

You'd still need to primary argument to 
aperture_remove_conflicting_devices(), but there will be no code 
duplication with the aperture helpers and the purpose of each code 
fragment will be clearer.

Best regards
Thomas

> -Daniel

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2023-01-12 10:24 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 15:41 [Intel-gfx] [PATCH 01/11] drm/ast: Use drm_aperture_remove_conflicting_pci_framebuffers Daniel Vetter
2023-01-11 15:41 ` [Intel-gfx] [PATCH 02/11] drm/gma500: " Daniel Vetter
2023-01-12  9:04   ` Thomas Zimmermann
2023-01-12  9:59     ` Daniel Vetter
2023-01-12 10:24       ` Thomas Zimmermann [this message]
2023-01-12 10:45         ` Daniel Vetter
2023-01-12 12:15           ` Thomas Zimmermann
2023-01-12 15:32             ` Daniel Vetter
2023-01-11 15:41 ` [Intel-gfx] [PATCH 03/11] drm/aperture: Remove primary argument Daniel Vetter
2023-01-11 15:49   ` Thomas Zimmermann
2023-01-11 15:41 ` [Intel-gfx] [PATCH 04/11] video/aperture: use generic code to figure out the vga default device Daniel Vetter
2023-01-11 15:59   ` Thomas Zimmermann
2023-01-11 16:51     ` Daniel Vetter
2023-01-11 15:41 ` [Intel-gfx] [PATCH 05/11] video/aperture: Only kick vgacon when the pdev is decoding vga Daniel Vetter
2023-01-11 16:03   ` Thomas Zimmermann
2023-01-11 16:55     ` Daniel Vetter
2023-01-11 15:41 ` [Intel-gfx] [PATCH 06/11] staging/lynxfb: Use pci aperture helper Daniel Vetter
2023-01-11 16:05   ` Thomas Zimmermann
2023-01-11 15:41 ` [Intel-gfx] [PATCH 07/11] fbdev/radeon: use pci aperture helpers Daniel Vetter
2023-01-11 15:41 ` [Intel-gfx] [PATCH 08/11] fbdev/hyperv: " Daniel Vetter
2023-01-11 15:41 ` [Intel-gfx] [PATCH 09/11] video/aperture: Move vga handling to pci function Daniel Vetter
2023-01-11 15:41 ` [Intel-gfx] [PATCH 10/11] video/aperture: Drop primary argument Daniel Vetter
2023-01-11 16:09   ` Thomas Zimmermann
2023-01-11 15:41 ` [Intel-gfx] [PATCH 11/11] video/aperture: Only remove sysfb on the default vga pci device Daniel Vetter
2023-01-11 16:20   ` Thomas Zimmermann
2023-01-11 16:37     ` Daniel Vetter
2023-01-12  7:48       ` Thomas Zimmermann
2023-01-11 16:43     ` Javier Martinez Canillas
2023-01-11 16:58   ` Javier Martinez Canillas
2023-01-11 19:21     ` Aaron Plattner
2023-01-12  7:55       ` Thomas Zimmermann
2023-01-12  8:44         ` Javier Martinez Canillas
2023-01-11 15:48 ` [Intel-gfx] [PATCH 01/11] drm/ast: Use drm_aperture_remove_conflicting_pci_framebuffers Thomas Zimmermann
2023-01-11 17:02   ` Daniel Vetter
2023-01-11 16:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/11] " Patchwork
2023-01-11 16:38 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-01-12  9:41 ` [Intel-gfx] [PATCH 01/11] " Thomas Zimmermann
2023-04-04 14:45 ` Thomas Zimmermann
2023-04-18  0:53   ` Jammy Huang

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=8a154783-b433-c9b8-bfe5-286dde1258e9@suse.de \
    --to=tzimmermann@suse.de \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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