dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@redhat.com, jfalempe@redhat.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	daniel@ffwll.ch, airlied@gmail.com
Cc: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Subject: [PATCH 00/10] drm/ast: Detect device type before init
Date: Mon, 13 Nov 2023 09:50:22 +0100	[thread overview]
Message-ID: <20231113091439.17181-1-tzimmermann@suse.de> (raw)

Detecting the ast device's chipset type and configuration mode
involves several registers, DT properties and possibly POSTing
parts of the chip. It is preferable to do this before initializing
the DRM driver, so that that each chip type can have an individual
setup code.

The patchset addresses the problem by moving all early detection
code before the allocation of the ast device.

Patch one gets a lock out of the way. The lock is only relevant
for mode setting. Move it there.

Patches 2 and 3 rework the detection of the correct I/O memory
ranges. It is now self-contained, more readable and works without
an instance of struct ast_device.

Patches 4 to 7 rework the setup of various registers that are
required for detection. Access helpers for I/O can now operate
without an instance of struct ast_device. The setup functions
operate on the I/O ranges that have been made available with
patch 3, but again without struct ast_device.

With the detection's internals done, patches 8 and 9 rework the
chip's and config-mode's detection code to operate without struct
ast_device as well.

Finally, patch 10 moves the detection code into the PCI probe
function. it runs before any of the DRM device code. The fucntion
for creating an ast device, ast_device_create(), receives the
detected I/O memory ranges, chip type and configuration mode.

This cleans up the detection code. There is more chip-specific
code in other parts of the driver. In a later patch, the ast device
setup can be split up so that each chip type gets its own code
path that does not interfere with other chips.

Tested on AST1100 and AST2100.

Thomas Zimmermann (10):
  drm/ast: Turn ioregs_lock to modeset_lock
  drm/ast: Rework I/O register setup
  drm/ast: Retrieve I/O-memory ranges without ast device
  drm/ast: Add I/O helpers without ast device
  drm/ast: Enable VGA without ast device instance
  drm/ast: Enable MMIO without ast device instance
  drm/ast: Partially implement POST without ast device instance
  drm/ast: Add enum ast_config_mode
  drm/ast: Detect ast device type and config mode without ast device
  drm/ast: Move detection code into PCI probe helper

 drivers/gpu/drm/ast/ast_drv.c  | 261 ++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/ast/ast_drv.h  | 101 +++++++++----
 drivers/gpu/drm/ast/ast_main.c | 244 ++----------------------------
 drivers/gpu/drm/ast/ast_mode.c |  26 ++--
 drivers/gpu/drm/ast/ast_post.c |  73 +++++----
 drivers/gpu/drm/ast/ast_reg.h  |  12 +-
 6 files changed, 411 insertions(+), 306 deletions(-)


base-commit: b7816c393496dc4497c1327310821407f7171d8b
prerequisite-patch-id: 0aa359f6144c4015c140c8a6750be19099c676fb
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
prerequisite-patch-id: cbc453ee02fae02af22fbfdce56ab732c7a88c36
-- 
2.42.0


             reply	other threads:[~2023-11-13  9:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13  8:50 Thomas Zimmermann [this message]
2023-11-13  8:50 ` [PATCH 01/10] drm/ast: Turn ioregs_lock to modeset_lock Thomas Zimmermann
2023-11-13  8:50 ` [PATCH 02/10] drm/ast: Rework I/O register setup Thomas Zimmermann
2023-11-13  8:50 ` [PATCH 03/10] drm/ast: Retrieve I/O-memory ranges without ast device Thomas Zimmermann
2023-11-13  8:50 ` [PATCH 04/10] drm/ast: Add I/O helpers " Thomas Zimmermann
2023-11-13  8:50 ` [PATCH 05/10] drm/ast: Enable VGA without ast device instance Thomas Zimmermann
2023-11-13  8:50 ` [PATCH 06/10] drm/ast: Enable MMIO " Thomas Zimmermann
2023-11-13  8:50 ` [PATCH 07/10] drm/ast: Partially implement POST " Thomas Zimmermann
2023-11-13  8:50 ` [PATCH 08/10] drm/ast: Add enum ast_config_mode Thomas Zimmermann
2023-11-13  8:50 ` [PATCH 09/10] drm/ast: Detect ast device type and config mode without ast device Thomas Zimmermann
2023-11-13 15:25   ` Jocelyn Falempe
2023-11-14  7:47     ` Thomas Zimmermann
2023-11-13  8:50 ` [PATCH 10/10] drm/ast: Move detection code into PCI probe helper Thomas Zimmermann
2023-11-13 15:30 ` [PATCH 00/10] drm/ast: Detect device type before init Jocelyn Falempe

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=20231113091439.17181-1-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jfalempe@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@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).