ast cleanups
Subsystems (3)
Thomas Zimmermann
maintainerv2 cover ast cleanups
Ast still has to be converted to managed initialization, and embed the DRM device in the ast structure. In preparation of these changes, add some cleanups to the driver.
Tested on ast HW.
v2:
* remove device tests from ast_pm_freeze() (Daniel)
* convert WARN_*() (Sam)
* typo fixes
Thomas Zimmermann (4):
drm/ast: Remove unused code paths for AST 1180
drm/ast: Remove test for device from ast_pm_freeze() drm/ast: Upcast from DRM device to ast structure via to_ast_private() drm/ast: Use per-device logging macros
drivers/gpu/drm/ast/ast_dp501.c | 24 +++---- drivers/gpu/drm/ast/ast_drv.c | 4 -- drivers/gpu/drm/ast/ast_drv.h | 7 +- drivers/gpu/drm/ast/ast_main.c | 115 +++++++++++++++----------------- drivers/gpu/drm/ast/ast_mode.c | 73 ++++++++++---------- drivers/gpu/drm/ast/ast_post.c | 28 ++++---- drivers/gpu/drm/ast/ast_ttm.c | 2 +- 7 files changed, 116 insertions(+), 137 deletions(-)
--
2.27.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerPATCH v2 1/4 drm/ast: Remove unused code paths for AST 1180
The ast driver contains code paths for AST 1180 chips. The chip is not supported and the rsp code has never been tested. Simplify the driver by removing the AST 1180 code.
--- drivers/gpu/drm/ast/ast_drv.c | 1 - drivers/gpu/drm/ast/ast_drv.h | 2 - drivers/gpu/drm/ast/ast_main.c | 89 +++++++++++++++------------------- drivers/gpu/drm/ast/ast_mode.c | 10 +--- drivers/gpu/drm/ast/ast_post.c | 10 ++-- 5 files changed, 43 insertions(+), 69 deletions(-)
drivers/gpu/drm/ast/ast_drv.c +0 -1
@@ -59,7 +59,6 @@ static struct drm_driver driver;static const struct pci_device_id pciidlist[] = {AST_VGA_DEVICE (PCI_CHIP_AST2000 ,NULL ),AST_VGA_DEVICE (PCI_CHIP_AST2100 ,NULL ), -/* AST_VGA_DEVICE(PCI_CHIP_AST1180, NULL), - don't bind to 1180 for now */ {0 ,0 ,0 }, };
drivers/gpu/drm/ast/ast_drv.h +0 -2
@@ -52,7 +52,6 @@#define PCI_CHIP_AST2000 0x2000#define PCI_CHIP_AST2100 0x2010 -#define PCI_CHIP_AST1180 0x1180enum ast_chip {
@@ -64,7 +63,6 @@ enum ast_chip {AST2300 ,AST2400 , AST2500, - AST1180, }; enum ast_tx_chip {
drivers/gpu/drm/ast/ast_main.c +39 -50
112 lines not on this page · raw message
drivers/gpu/drm/ast/ast_mode.c +1 -9
@@ -769,9 +769,6 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode) {struct ast_private *ast = crtc->dev->dev_private; -if (ast->chip ==AST1180 ) -return ; -/* TODO: Maybe control display signal generation with * Sync Enable (bit CR17.7). */
@@ -798,11 +795,6 @@ static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc,const struct drm_format_info *format;bool succ; -if (ast->chip ==AST1180 ) { -DRM_ERROR ("AST 1180 modesetting not supported\n" ); -return -EINVAL ; - } -if (!state->enable)return 0 ;/* no mode checks if CRTC is being disabled */
@@ -1044,7 +1036,7 @@ static enum drm_mode_status ast_mode_valid(struct drm_connector *connector,if ((ast->chip ==AST2100 ) || (ast->chip ==AST2200 ) || (ast->chip ==AST2300 ) || (ast->chip ==AST2400 ) || - (ast->chip ==AST2500 ) || (ast->chip ==AST1180 )) { + (ast->chip ==AST2500 )) {if ((mode->hdisplay ==1920 ) && (mode->vdisplay ==1080 ))return MODE_OK ;
drivers/gpu/drm/ast/ast_post.c +3 -7
@@ -58,13 +58,9 @@ bool ast_is_vga_enabled(struct drm_device *dev)struct ast_private *ast = dev->dev_private;u8 ch; -if (ast->chip ==AST1180 ) { -/* TODO 1180 */ - }else { - ch =ast_io_read8 (ast,AST_IO_VGA_ENABLE_PORT ); -return !!(ch &0x01 ); - } -return false; + ch =ast_io_read8 (ast,AST_IO_VGA_ENABLE_PORT ); + +return !!(ch &0x01 ); }static const u8 extreginfo[] = {0x0f ,0x04 ,0x1c ,0xff };
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerPATCH v2 2/4 drm/ast: Remove test for device from ast_pm_freeze()
In reply to Thomas ZimmermannThe driver cannot suspend before it has loaded completely. So the test for device pointers is not required. Remove them.
--- drivers/gpu/drm/ast/ast_drv.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/ast/ast_drv.c +0 -3
@@ -188,9 +188,6 @@ static int ast_pm_freeze(struct device *dev) {struct pci_dev *pdev =to_pci_dev (dev);struct drm_device *ddev =pci_get_drvdata (pdev); - -if (!ddev || !ddev->dev_private) -return -ENODEV ;return ast_drm_freeze (ddev); }
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 2/4] drm/ast: Remove test for device from ast_pm_freeze()
Quoted 4 lines · Thomas Zimmermann
The driver cannot suspend before it has loaded completely. So the test for device pointers is not required. Remove them.
Signed-off-by Thomas Zimmermann <[email protected]>
Sounds resonable.
Quoted 25 lines
--- drivers/gpu/drm/ast/ast_drv.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/ast/ast_drv.c +0
-3@@ -188,9 +188,6 @@ static int ast_pm_freeze(struct device *dev) {struct pci_dev *pdev =to_pci_dev (dev);struct drm_device *ddev =pci_get_drvdata (pdev); - -if (!ddev || !ddev->dev_private) -return -ENODEV ;return ast_drm_freeze (ddev); }Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerPATCH v2 3/4 drm/ast: Upcast from DRM device to ast structure via to_ast_private()
In reply to Thomas ZimmermannAll upcasting from struct drm_device to struct ast_private is now performed via to_ast_private(). Using struct drm_device.dev_private is deprecated. The ast variable in ast_crtc_helper_atomic_check() is unused, so removed it.
v2:
* fix typo in commit message
--- drivers/gpu/drm/ast/ast_dp501.c | 24 +++++++++---------- drivers/gpu/drm/ast/ast_drv.h | 5 ++++ drivers/gpu/drm/ast/ast_main.c | 10 ++++---- drivers/gpu/drm/ast/ast_mode.c | 41 ++++++++++++++++----------------- drivers/gpu/drm/ast/ast_post.c | 16 ++++++------- 5 files changed, 50 insertions(+), 46 deletions(-)
drivers/gpu/drm/ast/ast_dp501.c +12 -12
@@ -10,7 +10,7 @@ MODULE_FIRMWARE("ast_dp501_fw.bin");static int ast_load_dp501_microcode (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);return request_firmware (&ast->dp501_fw,"ast_dp501_fw.bin" , dev->dev); }
@@ -93,7 +93,7 @@ static bool wait_fw_ready(struct ast_private *ast)static bool ast_write_cmd (struct drm_device *dev,u8 data) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);int retry =0 ;if (wait_nack (ast)) {send_nack (ast);
@@ -115,7 +115,7 @@ static bool ast_write_cmd(struct drm_device *dev, u8 data)static bool ast_write_data (struct drm_device *dev,u8 data) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);if (wait_nack (ast)) {send_nack (ast);
@@ -133,7 +133,7 @@ static bool ast_write_data(struct drm_device *dev, u8 data)#if 0 static bool ast_read_data (struct drm_device *dev,u8 *data) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u8 tmp; *data =0 ;
@@ -172,7 +172,7 @@ static u32 get_fw_base(struct ast_private *ast)bool ast_backup_fw (struct drm_device *dev,u8 *addr,u32 size) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u32 i, data;u32 boot_address;
@@ -188,7 +188,7 @@ bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size)static bool ast_launch_m68k (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u32 i, data, len =0 ;u32 boot_address;u8 *fw_addr =NULL ;
@@ -255,7 +255,7 @@ static bool ast_launch_m68k(struct drm_device *dev)u8 ast_get_dp501_max_clk (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u32 boot_address, offset, data;u8 linkcap[4 ], linkrate, linklanes, maxclk =0xff ;
@@ -283,7 +283,7 @@ u8 ast_get_dp501_max_clk(struct drm_device *dev)bool ast_dp501_read_edid (struct drm_device *dev,u8 *ediddata) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u32 i, boot_address, offset, data; boot_address =get_fw_base (ast);
@@ -312,7 +312,7 @@ bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata)static bool ast_init_dvo (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u8 jreg;u32 data;ast_write32 (ast,0xf004 ,0x1e6e0000 );
@@ -385,7 +385,7 @@ static bool ast_init_dvo(struct drm_device *dev)static void ast_init_analog (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u32 data;/*
@@ -412,7 +412,7 @@ static void ast_init_analog(struct drm_device *dev)void ast_init_3rdtx (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u8 jreg;if (ast->chip ==AST2300 || ast->chip ==AST2400 ) {
@@ -438,7 +438,7 @@ void ast_init_3rdtx(struct drm_device *dev)void ast_release_firmware (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);release_firmware (ast->dp501_fw); ast->dp501_fw =NULL ;
drivers/gpu/drm/ast/ast_drv.h +5 -0
@@ -136,6 +136,11 @@ struct ast_private {const struct firmware *dp501_fw;/* dp501 fw */ }; +static inline struct ast_private *to_ast_private (struct drm_device *dev) +{ +return dev->dev_private; +} +int ast_driver_load (struct drm_device *dev,unsigned long flags);void ast_driver_unload (struct drm_device *dev);
drivers/gpu/drm/ast/ast_main.c +5 -5
@@ -67,7 +67,7 @@ uint8_t ast_get_index_reg_mask(struct ast_private *ast,static void ast_detect_config_mode (struct drm_device *dev,u32 *scu_rev) {struct device_node *np = dev->pdev->dev.of_node; -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);uint32_t data, jregd0, jregd1;/* Defaults */
@@ -117,7 +117,7 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev)static int ast_detect_chip (struct drm_device *dev,bool *need_post) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);uint32_t jreg, scu_rev;/*
@@ -262,7 +262,7 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)static int ast_get_dram_info (struct drm_device *dev) {struct device_node *np = dev->pdev->dev.of_node; -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);uint32_t mcr_cfg, mcr_scu_mpll, mcr_scu_strap;uint32_t denum, num, div, ref_pll, dsel;
@@ -388,7 +388,7 @@ static const struct drm_mode_config_funcs ast_mode_funcs = {static u32 ast_get_vram_info (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u8 jreg;u32 vram_size;ast_open_key (ast);
@@ -509,7 +509,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)void ast_driver_unload (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);/* enable standard VGA decode */ ast_set_index_reg (ast,AST_IO_CRTC_PORT ,0xa1 ,0x04 );
drivers/gpu/drm/ast/ast_mode.c +20 -21
167 lines not on this page · raw message
drivers/gpu/drm/ast/ast_post.c +8 -8
@@ -39,7 +39,7 @@ static void ast_post_chip_2500(struct drm_device *dev);void ast_enable_vga (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);ast_io_write8 (ast,AST_IO_VGA_ENABLE_PORT ,0x01 );ast_io_write8 (ast,AST_IO_MISC_PORT_WRITE ,0x01 );
@@ -47,7 +47,7 @@ void ast_enable_vga(struct drm_device *dev)void ast_enable_mmio (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);ast_set_index_reg (ast,AST_IO_CRTC_PORT ,0xa1 ,0x06 ); }
@@ -55,7 +55,7 @@ void ast_enable_mmio(struct drm_device *dev)bool ast_is_vga_enabled (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u8 ch; ch =ast_io_read8 (ast,AST_IO_VGA_ENABLE_PORT );
@@ -70,7 +70,7 @@ static const u8 extreginfo_ast2300[] = { 0x0f, 0x04, 0x1f, 0xff };static void ast_set_def_ext_reg (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u8 i, index, reg;const u8 *ext_reg_info;
@@ -272,7 +272,7 @@ static void cbrdlli_ast2150(struct ast_private *ast, int busw)static void ast_init_dram_reg (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u8 j;u32 data, temp, i;const struct ast_dramstruct *dram_reg_info;
@@ -366,7 +366,7 @@ static void ast_init_dram_reg(struct drm_device *dev)void ast_post_gpu (struct drm_device *dev) {u32 reg; -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);pci_read_config_dword (ast->dev->pdev,0x04 , ®); reg |=0x3 ;
@@ -1596,7 +1596,7 @@ static void ddr2_init(struct ast_private *ast, struct ast2300_dram_param *param)static void ast_post_chip_2300 (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);struct ast2300_dram_param param;u32 temp;u8 reg;
@@ -2028,7 +2028,7 @@ static bool ast_dram_init_2500(struct ast_private *ast)void ast_post_chip_2500 (struct drm_device *dev) { -struct ast_private *ast = dev->dev_private; +struct ast_private *ast =to_ast_private (dev);u32 temp;u8 reg;
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerPATCH v2 4/4 drm/ast: Use per-device logging macros
In reply to Thomas ZimmermannConverts the ast driver to drm_info(), drm_err() and drm_WARN_*(). No functional changes are made.
v2:
* also convert WARN_*() macros
--- drivers/gpu/drm/ast/ast_main.c | 34 +++++++++++++++++----------------- drivers/gpu/drm/ast/ast_mode.c | 26 +++++++++++++++----------- drivers/gpu/drm/ast/ast_post.c | 2 +- drivers/gpu/drm/ast/ast_ttm.c | 2 +- 4 files changed, 34 insertions(+), 30 deletions(-)
drivers/gpu/drm/ast/ast_main.c +17 -17
@@ -79,7 +79,7 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) scu_rev)) {/* We do, disable P2A access */ ast->config_mode = ast_use_dt; -DRM_INFO ("Using device-tree for configuration\n" ); +drm_info (dev,"Using device-tree for configuration\n" );return ; }
@@ -101,7 +101,7 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev)/* P2A works, grab silicon revision */ ast->config_mode = ast_use_p2a; -DRM_INFO ("Using P2A bridge for configuration\n" ); +drm_info (dev,"Using P2A bridge for configuration\n" );/* Read SCU7c (silicon revision register) */ ast_write32 (ast,0xf004 ,0x1e6e0000 );
@@ -112,7 +112,7 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) }/* We have a P2A bridge but it's disabled */ -DRM_INFO ("P2A bridge disabled, using default configuration\n" ); +drm_info (dev,"P2A bridge disabled, using default configuration\n" ); }static int ast_detect_chip (struct drm_device *dev,bool *need_post)
@@ -128,7 +128,7 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)*/ if (!ast_is_vga_enabled (dev)) {ast_enable_vga (dev); -DRM_INFO ("VGA not enabled on entry, requesting chip POST\n" ); +drm_info (dev,"VGA not enabled on entry, requesting chip POST\n" ); *need_post = true; }else *need_post = false;
@@ -144,36 +144,36 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)/* Identify chipset */ if (dev->pdev->revision >=0x40 ) { ast->chip =AST2500 ; -DRM_INFO ("AST 2500 detected\n" ); +drm_info (dev,"AST 2500 detected\n" ); }else if (dev->pdev->revision >=0x30 ) { ast->chip =AST2400 ; -DRM_INFO ("AST 2400 detected\n" ); +drm_info (dev,"AST 2400 detected\n" ); }else if (dev->pdev->revision >=0x20 ) { ast->chip =AST2300 ; -DRM_INFO ("AST 2300 detected\n" ); +drm_info (dev,"AST 2300 detected\n" ); }else if (dev->pdev->revision >=0x10 ) {switch (scu_rev &0x0300 ) {case 0x0200 : ast->chip =AST1100 ; -DRM_INFO ("AST 1100 detected\n" ); +drm_info (dev,"AST 1100 detected\n" );break ;case 0x0100 : ast->chip =AST2200 ; -DRM_INFO ("AST 2200 detected\n" ); +drm_info (dev,"AST 2200 detected\n" );break ;case 0x0000 : ast->chip =AST2150 ; -DRM_INFO ("AST 2150 detected\n" ); +drm_info (dev,"AST 2150 detected\n" );break ;default : ast->chip =AST2100 ; -DRM_INFO ("AST 2100 detected\n" ); +drm_info (dev,"AST 2100 detected\n" );break ; } ast->vga2_clone = false; }else { ast->chip =AST2000 ; -DRM_INFO ("AST 2000 detected\n" ); +drm_info (dev,"AST 2000 detected\n" ); }/* Check if we support wide screen */
@@ -248,13 +248,13 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)/* Print stuff for diagnostic purposes */ switch (ast->tx_chip_type) {case AST_TX_SIL164 : -DRM_INFO ("Using Sil164 TMDS transmitter\n" ); +drm_info (dev,"Using Sil164 TMDS transmitter\n" );break ;case AST_TX_DP501 : -DRM_INFO ("Using DP501 DisplayPort transmitter\n" ); +drm_info (dev,"Using DP501 DisplayPort transmitter\n" );break ;default : -DRM_INFO ("Analog VGA only\n" ); +drm_info (dev,"Analog VGA only\n" ); }return 0 ; }
@@ -443,7 +443,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)* and higher). */ if (!(pci_resource_flags (dev->pdev,2 ) &IORESOURCE_IO )) { -DRM_INFO ("platform has no IO space, trying MMIO\n" ); +drm_info (dev,"platform has no IO space, trying MMIO\n" ); ast->ioregs = ast->regs +AST_IO_MM_OFFSET ; }
@@ -465,7 +465,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)if (ret) goto out_free; ast->vram_size =ast_get_vram_info (dev); -DRM_INFO ("dram MCLK=%u Mhz type=%d bus_width=%d size=%08x\n" , +drm_info (dev,"dram MCLK=%u Mhz type=%d bus_width=%d size=%08x\n" , ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size);
drivers/gpu/drm/ast/ast_mode.c +15 -11
@@ -566,14 +566,15 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct ast_private *ast = to_ast_private(plane->dev); + struct drm_device *dev = plane->dev; +struct ast_private *ast =to_ast_private (dev);struct drm_plane_state *state = plane->state;struct drm_gem_vram_object *gbo;s64 gpu_addr; gbo =drm_gem_vram_of_gem (state->fb->obj[0 ]); gpu_addr =drm_gem_vram_offset (gbo); -if (WARN_ON_ONCE (gpu_addr <0 )) +if (drm_WARN_ON_ONCE (dev, gpu_addr <0 ))return ;/* Bug: we didn't pin the BO to VRAM in prepare_fb. */ ast_set_offset_reg (ast, state->fb);
@@ -620,6 +621,7 @@ static int ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane, struct drm_plane_state *new_state) { + struct drm_device *dev = plane->dev;struct drm_framebuffer *fb = new_state->fb;struct drm_crtc *crtc = new_state->crtc;struct drm_gem_vram_object *gbo;
@@ -630,11 +632,11 @@ ast_cursor_plane_helper_prepare_fb(struct drm_plane *plane,if (!crtc || !fb)return 0 ; -if (WARN_ON_ONCE (fb->width >AST_MAX_HWC_WIDTH ) || -WARN_ON_ONCE (fb->height >AST_MAX_HWC_HEIGHT )) +if (drm_WARN_ON_ONCE (dev, fb->width >AST_MAX_HWC_WIDTH ) || +drm_WARN_ON_ONCE (dev, fb->height >AST_MAX_HWC_HEIGHT ))return -EINVAL ;/* BUG: didn't test in atomic_check() */ - ast =to_ast_private (crtc->dev); + ast =to_ast_private (dev); gbo =drm_gem_vram_of_gem (fb->obj[0 ]); src =drm_gem_vram_vmap (gbo);
@@ -703,6 +705,7 @@ static void ast_cursor_plane_helper_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { + struct drm_device *dev = plane->dev;struct drm_plane_state *state = plane->state;struct drm_crtc *crtc = state->crtc;struct drm_framebuffer *fb = state->fb;
@@ -719,7 +722,7 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,/* A new cursor image was installed. */ gbo = ast->cursor.gbo[ast->cursor.next_index]; off =drm_gem_vram_offset (gbo); -if (WARN_ON_ONCE (off <0 )) +if (drm_WARN_ON_ONCE (dev, off <0 ))return ;/* Bug: we didn't pin cursor HW BO to VRAM. */ ast_cursor_set_base (ast, off);
@@ -898,8 +901,9 @@ static struct drm_crtc_state * ast_crtc_atomic_duplicate_state(struct drm_crtc *crtc) {struct ast_crtc_state *new_ast_state, *ast_state; +struct drm_device *dev = crtc->dev; -if (WARN_ON (!crtc->state)) +if (drm_WARN_ON (dev, !crtc->state))return NULL ; new_ast_state =kmalloc (sizeof (*new_ast_state),GFP_KERNEL );
@@ -1105,7 +1109,7 @@ static int ast_connector_init(struct drm_device *dev) connector = &ast_connector->base; ast_connector->i2c =ast_i2c_create (dev);if (!ast_connector->i2c) -DRM_ERROR ("failed to add ddc bus for connector\n" ); +drm_err (dev,"failed to add ddc bus for connector\n" ); drm_connector_init_with_ddc(dev, connector, &ast_connector_funcs,
@@ -1189,7 +1193,7 @@ int ast_mode_init(struct drm_device *dev)ARRAY_SIZE (ast_primary_plane_formats), NULL, DRM_PLANE_TYPE_PRIMARY, NULL);if (ret) { -DRM_ERROR ("ast: drm_universal_plane_init() failed: %d\n" , ret); +drm_err (dev,"ast: drm_universal_plane_init() failed: %d\n" , ret);return ret; } drm_plane_helper_add(&ast->primary_plane,
@@ -1201,7 +1205,7 @@ int ast_mode_init(struct drm_device *dev)ARRAY_SIZE (ast_cursor_plane_formats), NULL, DRM_PLANE_TYPE_CURSOR, NULL);if (ret) { -DRM_ERROR ("drm_universal_plane_failed(): %d\n" , ret); +drm_err (dev,"drm_universal_plane_failed(): %d\n" , ret);return ret; } drm_plane_helper_add(&ast->cursor_plane,
@@ -1323,7 +1327,7 @@ static struct ast_i2c_chan *ast_i2c_create(struct drm_device *dev) i2c->bit.getscl = get_clock; ret =i2c_bit_add_bus (&i2c->adapter);if (ret) { -DRM_ERROR ("Failed to register bit i2c\n" ); +drm_err (dev,"Failed to register bit i2c\n" ); goto out_free; }
drivers/gpu/drm/ast/ast_post.c +1 -1
@@ -2067,7 +2067,7 @@ void ast_post_chip_2500(struct drm_device *dev) }if (!ast_dram_init_2500 (ast)) -DRM_ERROR ("DRAM init failed !\n" ); +drm_err (dev,"DRAM init failed !\n" ); temp =ast_mindwm (ast,0x1e6e2040 );ast_moutdwm (ast,0x1e6e2040 , temp |0x40 );
drivers/gpu/drm/ast/ast_ttm.c +1 -1
@@ -44,7 +44,7 @@ int ast_mm_init(struct ast_private *ast) ast->vram_size);if (IS_ERR (vmm)) { ret =PTR_ERR (vmm); -DRM_ERROR ("Error initializing VRAM MM; %d\n" , ret); +drm_err (dev,"Error initializing VRAM MM; %d\n" , ret);return ret; }
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel