Re: [PATCH10 3/3] ARM:drm ivip Intel FPGA Video and Image Processing Suite

From: Noralf TrÃnnes
Date: Thu Aug 16 2018 - 05:10:15 EST



Den 16.08.2018 10.33, skrev Ong, Hean Loong:
On Wed, 2018-08-15 at 14:26 +0200, Noralf TrÃnnes wrote:
Den 14.08.2018 10.57, skrev Hean-Loong, Ong:
From: Ong Hean Loong <hean.loong.ong@xxxxxxxxx>

Driver for Intel FPGA Video and Image Processing Suite Frame Buffer
II.
The driver only supports the Intel Arria10 devkit and its variants.
This driver can be either loaded staticlly or in modules.
The OF device tree binding is located at:
Documentation/devicetree/bindings/display/altr,vip-fb2.txt

Signed-off-by: Ong Hean Loong <hean.loong.ong@xxxxxxxxx>
---

<snip>

+int intelvipfb_probe(struct device *dev)
+{
+ int retval;
+ struct drm_device *drm;
+ struct intelvipfb_priv *fbpriv = dev_get_drvdata(dev);
+ struct drm_connector *connector;
+ u32 formats[] = {DRM_FORMAT_XRGB8888};
+
+ drm = fbpriv->drm;
+
+ drm->dev_private = fbpriv;
+
+ intelvipfb_setup_mode_config(drm);
+
+ connector = intelvipfb_conn_setup(drm);
+ if (!connector) {
+ dev_err(drm->dev, "Connector setup failed\n");
+ goto err_mode_config;
+ }
+
+ retval = drm_simple_display_pipe_init(drm, &fbpriv->pipe,
+ ÂÂÂÂÂÂ&fbpriv_funcs,
formats,
+ ARRAY_SIZE(formats), NULL, connector);
+ if (retval < 0) {
+ dev_err(drm->dev, "Cannot setup simple display
pipe\n");
+ goto err_mode_config;
+ }
+
+ fbpriv->fbcma = drm_fbdev_cma_init(drm,
+ drm->mode_config.preferred_depth,
+ drm->mode_config.num_connector);
Please use drm_fbdev_generic_setup() for fbdev emulation. It tears
down
automatically on drm_dev_unregister() and you don't need the
drm_driver->lastclose hook.

All drivers that use drm_fbdev_cma_init() will move to this shortly.

Noralf.

I could not find any examples that currently uses
theÂdrm_fbdev_generic_setup (). Would you mind pointing me on where
such examples are available that would allow me to replace the
assignment of the fbcma pointer withÂdrm_fbdev_generic_setup() method

This is the only one converted so far:
Commit: dff1c7032ffea20cca2ad3973ed4c69c8182683d
drm/tinydrm: Use drm_fbdev_generic_setup()

Noralf.