Ping...
Review 2. [PATCH] drm: add drm device name (Jiang, Sonny), please.
Thanks,
Sonny
From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> on behalf of amd-gfx-request@xxxxxxxxxxxxxxxxxxxxx <amd-gfx-request@xxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, September 3, 2019 9:17 PM To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx <amd-gfx@xxxxxxxxxxxxxxxxxxxxx> Subject: amd-gfx Digest, Vol 40, Issue 37 Send amd-gfx mailing list submissions to
amd-gfx@xxxxxxxxxxxxxxxxxxxxx To subscribe or unsubscribe via the World Wide Web, visit https://lists.freedesktop.org/mailman/listinfo/amd-gfx or, via email, send a message with subject or body 'help' to amd-gfx-request@xxxxxxxxxxxxxxxxxxxxx You can reach the person managing the list at amd-gfx-owner@xxxxxxxxxxxxxxxxxxxxx When replying, please edit your Subject line so it is more specific than "Re: Contents of amd-gfx digest..." Today's Topics: 1. Re: [PATCH v2 06/27] drm/dp_mst: Combine redundant cases in drm_dp_encode_sideband_req() (Dave Airlie) 2. [PATCH] drm: add drm device name (Jiang, Sonny) 3. Re: [PATCH v2 11/27] drm/dp_mst: Constify guid in drm_dp_get_mst_branch_by_guid() (Dave Airlie) 4. Re: [PATCH v2 15/27] drm/dp_mst: Cleanup drm_dp_send_link_address() a bit (Dave Airlie) 5. RE: [PATCH] drm/amd/powerplay: replace smu->table_count with SMU_TABLE_COUNT in smu (Quan, Evan) ---------------------------------------------------------------------- Message: 1 Date: Wed, 4 Sep 2019 07:35:59 +1000 From: Dave Airlie <airlied@xxxxxxxxx> To: Lyude Paul <lyude@xxxxxxxxxx> Cc: dri-devel <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, nouveau <nouveau@xxxxxxxxxxxxxxxxxxxxx>, amd-gfx mailing list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, Sean Paul <sean@xxxxxxxxxx>, David Airlie <airlied@xxxxxxxx>, Daniel Vetter <daniel.vetter@xxxxxxxx>, Imre Deak <imre.deak@xxxxxxxxx>, Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Maxime Ripard <mripard@xxxxxxxxxx>, Juston Li <juston.li@xxxxxxxxx>, Daniel Vetter <daniel@xxxxxxxx>, Harry Wentland <hwentlan@xxxxxxx>, Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> Subject: Re: [PATCH v2 06/27] drm/dp_mst: Combine redundant cases in drm_dp_encode_sideband_req() Message-ID: <CAPM=9tx1vQMEsw4VjDVCbDYFUiaeHNCfP09aiSxnPnucQuB1JQ@xxxxxxxxxxxxxx> Content-Type: text/plain; charset="UTF-8" On Wed, 4 Sep 2019 at 06:48, Lyude Paul <lyude@xxxxxxxxxx> wrote: > > Noticed this while working on adding a drm_dp_decode_sideband_req(). > DP_POWER_DOWN_PHY/DP_POWER_UP_PHY both use the same struct, so we can > just combine their cases. both use the same struct as enum path resources? Since otherwise the patch doesn't make sense. With that fixed: Reviewed-by: Dave Airlie <airlied@xxxxxxxxxx> ------------------------------ Message: 2 Date: Tue, 3 Sep 2019 21:41:10 +0000 From: "Jiang, Sonny" <Sonny.Jiang@xxxxxxx> To: "amd-gfx@xxxxxxxxxxxxxxxxxxxxx" <amd-gfx@xxxxxxxxxxxxxxxxxxxxx> Cc: "Jiang, Sonny" <Sonny.Jiang@xxxxxxx> Subject: [PATCH] drm: add drm device name Message-ID: <20190903214040.2386-1-sonny.jiang@xxxxxxx> Content-Type: text/plain; charset="iso-8859-1" Add DRM device name and use DRM_IOCTL_VERSION ioctl drmVersion::desc passing it to user space instead of unused DRM driver name descriptor. Change-Id: I809f6d3e057111417efbe8fa7cab8f0113ba4b21 Signed-off-by: Sonny Jiang <sonny.jiang@xxxxxxx> --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ drivers/gpu/drm/drm_drv.c | 17 +++++++++++++++++ drivers/gpu/drm/drm_ioctl.c | 2 +- include/drm/drm_device.h | 3 +++ include/drm/drm_drv.h | 1 + 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 67b09cb2a9e2..8f0971cea363 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2809,6 +2809,8 @@ int amdgpu_device_init(struct amdgpu_device *adev, /* init the mode config */ drm_mode_config_init(adev->ddev); + drm_dev_set_name(adev->ddev, amdgpu_asic_name[adev->asic_type]); + r = amdgpu_device_ip_init(adev); if (r) { /* failed in exclusive mode due to timeout */ diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 862621494a93..6c33879bb538 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -802,6 +802,7 @@ void drm_dev_fini(struct drm_device *dev) mutex_destroy(&dev->struct_mutex); drm_legacy_destroy_members(dev); kfree(dev->unique); + kfree(dev->name); } EXPORT_SYMBOL(drm_dev_fini); @@ -1078,6 +1079,22 @@ int drm_dev_set_unique(struct drm_device *dev, const char *name) } EXPORT_SYMBOL(drm_dev_set_unique); +/** + * drm_dev_set_name - Set the name of a DRM device + * @dev: device of which to set the name + * @name: name to be set + * + * Return: 0 on success or a negative error code on failure. + */ +int drm_dev_set_name(struct drm_device *dev, const char *name) +{ + kfree(dev->name); + dev->name = kstrdup(name, GFP_KERNEL); + + return dev->name ? 0 : -ENOMEM; +} +EXPORT_SYMBOL(drm_dev_set_name); + /* * DRM Core * The DRM core module initializes all global DRM objects and makes them diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 2263e3ddd822..61f02965106b 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -506,7 +506,7 @@ int drm_version(struct drm_device *dev, void *data, dev->driver->date); if (!err) err = drm_copy_field(version->desc, &version->desc_len, - dev->driver->desc); + dev->name); return err; } diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h index 7f9ef709b2b6..e29912c484e4 100644 --- a/include/drm/drm_device.h +++ b/include/drm/drm_device.h @@ -123,6 +123,9 @@ struct drm_device { /** @unique: Unique name of the device */ char *unique; + /** @name: device name */ + char *name; + /** * @struct_mutex: * diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 68ca736c548d..f742e2bde467 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -798,6 +798,7 @@ static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) int drm_dev_set_unique(struct drm_device *dev, const char *name); +int drm_dev_set_name(struct drm_device *dev, const char *name); #endif -- 2.17.1 ------------------------------ Message: 3 Date: Wed, 4 Sep 2019 07:41:07 +1000 From: Dave Airlie <airlied@xxxxxxxxx> To: Lyude Paul <lyude@xxxxxxxxxx> Cc: dri-devel <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, nouveau <nouveau@xxxxxxxxxxxxxxxxxxxxx>, amd-gfx mailing list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, Sean Paul <sean@xxxxxxxxxx>, David Airlie <airlied@xxxxxxxx>, Daniel Vetter <daniel.vetter@xxxxxxxx>, Imre Deak <imre.deak@xxxxxxxxx>, Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Maxime Ripard <mripard@xxxxxxxxxx>, Juston Li <juston.li@xxxxxxxxx>, Daniel Vetter <daniel@xxxxxxxx>, Harry Wentland <hwentlan@xxxxxxx>, Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> Subject: Re: [PATCH v2 11/27] drm/dp_mst: Constify guid in drm_dp_get_mst_branch_by_guid() Message-ID: <CAPM=9tz0fdZpfFAfQ0aCQ4D+0XQGm=zqeFKDHPFNwVEUeM1f5g@xxxxxxxxxxxxxx> Content-Type: text/plain; charset="UTF-8" On Wed, 4 Sep 2019 at 06:48, Lyude Paul <lyude@xxxxxxxxxx> wrote: > > And it's helper, we'll be using this in just a moment. > Reviewed-by: Dave Airlie <airlied@xxxxxxxxxx> > Cc: Juston Li <juston.li@xxxxxxxxx> > Cc: Imre Deak <imre.deak@xxxxxxxxx> > Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > Cc: Harry Wentland <hwentlan@xxxxxxx> > Cc: Daniel Vetter <daniel.vetter@xxxxxxxx> > Signed-off-by: Lyude Paul <lyude@xxxxxxxxxx> > --- > drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c > index 43452872efad..b44d3696c09a 100644 > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > @@ -2060,7 +2060,7 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_ > > static struct drm_dp_mst_branch *get_mst_branch_device_by_guid_helper( > struct drm_dp_mst_branch *mstb, > - uint8_t *guid) > + const uint8_t *guid) > { > struct drm_dp_mst_branch *found_mstb; > struct drm_dp_mst_port *port; > @@ -2084,7 +2084,7 @@ static struct drm_dp_mst_branch *get_mst_branch_device_by_guid_helper( > > static struct drm_dp_mst_branch * > drm_dp_get_mst_branch_device_by_guid(struct drm_dp_mst_topology_mgr *mgr, > - uint8_t *guid) > + const uint8_t *guid) > { > struct drm_dp_mst_branch *mstb; > int ret; > -- > 2.21.0 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ------------------------------ Message: 4 Date: Wed, 4 Sep 2019 07:42:16 +1000 From: Dave Airlie <airlied@xxxxxxxxx> To: Lyude Paul <lyude@xxxxxxxxxx> Cc: dri-devel <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, nouveau <nouveau@xxxxxxxxxxxxxxxxxxxxx>, amd-gfx mailing list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, Sean Paul <sean@xxxxxxxxxx>, David Airlie <airlied@xxxxxxxx>, Daniel Vetter <daniel.vetter@xxxxxxxx>, Imre Deak <imre.deak@xxxxxxxxx>, Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Maxime Ripard <mripard@xxxxxxxxxx>, Juston Li <juston.li@xxxxxxxxx>, Daniel Vetter <daniel@xxxxxxxx>, Harry Wentland <hwentlan@xxxxxxx>, Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> Subject: Re: [PATCH v2 15/27] drm/dp_mst: Cleanup drm_dp_send_link_address() a bit Message-ID: <CAPM=9ty-264nFotVRy7VwMw_BQPo-=7su7y3J2MjC9Sdkxcu+A@xxxxxxxxxxxxxx> Content-Type: text/plain; charset="UTF-8" On Wed, 4 Sep 2019 at 06:48, Lyude Paul <lyude@xxxxxxxxxx> wrote: > > Declare local pointer to the drm_dp_link_address_ack_reply struct > instead of constantly dereferencing it through the union in > txmsg->reply. Then, invert the order of conditionals so we don't have to > do the bulk of the work inside them, and can wrap lines even less. Then > finally, rearrange variable declarations a bit. > > Cc: Juston Li <juston.li@xxxxxxxxx> > Cc: Imre Deak <imre.deak@xxxxxxxxx> > Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > Cc: Harry Wentland <hwentlan@xxxxxxx> > Cc: Daniel Vetter <daniel.vetter@xxxxxxxx> > Signed-off-by: Lyude Paul <lyude@xxxxxxxxxx> Reviewed-by: Dave Airlie <airlied@xxxxxxxxxx> ------------------------------ Message: 5 Date: Wed, 4 Sep 2019 01:17:19 +0000 From: "Quan, Evan" <Evan.Quan@xxxxxxx> To: "Wang, Kevin(Yang)" <Kevin1.Wang@xxxxxxx>, "amd-gfx@xxxxxxxxxxxxxxxxxxxxx" <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx> Cc: "Wang, Kevin(Yang)" <Kevin1.Wang@xxxxxxx> Subject: RE: [PATCH] drm/amd/powerplay: replace smu->table_count with SMU_TABLE_COUNT in smu Message-ID: <MN2PR12MB3344CB5D45A7FE830BDC4E34E4B80@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> Content-Type: text/plain; charset="utf-8" Please drop the table_count member from the smu_table structure as it's totally unused. With that fixed, the patch is reviewed-by: Evan Quan <evan.quan@xxxxxxx> > -----Original Message----- > From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of > Wang, Kevin(Yang) > Sent: 2019年9月3日 16:17 > To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Huang, Ray <Ray.Huang@xxxxxxx> > Cc: Wang, Kevin(Yang) <Kevin1.Wang@xxxxxxx> > Subject: [PATCH] drm/amd/powerplay: replace smu->table_count with > SMU_TABLE_COUNT in smu > > fix bellow patch issue: > drm/amd/powerplay: introduce smu table id type to handle the smu table > for each asic > ---- > "This patch introduces new smu table type, it's to handle the different smu > table defines for each asic with the same smu ip." > > before: > use smu->table_count to represent the actual table count in smc firmware > use actual table count to check smu function parameter about smu table > after: > use logic table count "SMU_TABLE_COUNT" to check function parameter > because table id already mapped in smu driver, and smu function will use > logic table id not actual table id to check func parameter. > > Signed-off-by: Kevin Wang <kevin1.wang@xxxxxxx> > --- > drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 13 ++++--------- > drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 1 - > drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 1 - > drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 1 - > drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 5 ++--- > drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 1 - > 6 files changed, 6 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > index 6f435d60fe86..c71a82a6a785 100644 > --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > @@ -462,7 +462,7 @@ int smu_update_table(struct smu_context *smu, > enum smu_table_id table_index, int > int ret = 0; > int table_id = smu_table_get_index(smu, table_index); > > - if (!table_data || table_id >= smu_table->table_count || table_id < 0) > + if (!table_data || table_id >= SMU_TABLE_COUNT || table_id < 0) > return -EINVAL; > > table = &smu_table->tables[table_index]; @@ -940,14 +940,10 @@ > static int smu_init_fb_allocations(struct smu_context *smu) > struct amdgpu_device *adev = smu->adev; > struct smu_table_context *smu_table = &smu->smu_table; > struct smu_table *tables = smu_table->tables; > - uint32_t table_count = smu_table->table_count; > uint32_t i = 0; > int32_t ret = 0; > > - if (table_count <= 0) > - return -EINVAL; > - > - for (i = 0 ; i < table_count; i++) { > + for (i = 0; i < SMU_TABLE_COUNT; i++) { > if (tables[i].size == 0) > continue; > ret = amdgpu_bo_create_kernel(adev, > @@ -978,13 +974,12 @@ static int smu_fini_fb_allocations(struct > smu_context *smu) { > struct smu_table_context *smu_table = &smu->smu_table; > struct smu_table *tables = smu_table->tables; > - uint32_t table_count = smu_table->table_count; > uint32_t i = 0; > > - if (table_count == 0 || tables == NULL) > + if (!tables) > return 0; > > - for (i = 0 ; i < table_count; i++) { > + for (i = 0; i < SMU_TABLE_COUNT; i++) { > if (tables[i].size == 0) > continue; > amdgpu_bo_free_kernel(&tables[i].bo, > diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c > b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c > index f1f072012fac..6e8eb0f94c8b 100644 > --- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c > +++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c > @@ -1934,5 +1934,4 @@ void arcturus_set_ppt_funcs(struct smu_context > *smu) > struct smu_table_context *smu_table = &smu->smu_table; > > smu->ppt_funcs = &arcturus_ppt_funcs; > - smu_table->table_count = TABLE_COUNT; > } > diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c > b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c > index 744b7501c34d..e3add8b59291 100644 > --- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c > +++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c > @@ -1633,5 +1633,4 @@ void navi10_set_ppt_funcs(struct smu_context > *smu) > struct smu_table_context *smu_table = &smu->smu_table; > > smu->ppt_funcs = &navi10_ppt_funcs; > - smu_table->table_count = TABLE_COUNT; > } > diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c > b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c > index de43159564a5..2b953f7431b6 100644 > --- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c > +++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c > @@ -169,5 +169,4 @@ void renoir_set_ppt_funcs(struct smu_context *smu) > > smu->ppt_funcs = &renoir_ppt_funcs; > smu->smc_if_version = SMU12_DRIVER_IF_VERSION; > - smu_table->table_count = TABLE_COUNT; > } > diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c > b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c > index deca9f85764c..3709e4d77338 100644 > --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c > +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c > @@ -439,7 +439,7 @@ static int smu_v11_0_init_smc_tables(struct > smu_context *smu) > struct smu_table *tables = NULL; > int ret = 0; > > - if (smu_table->tables || smu_table->table_count == 0) > + if (smu_table->tables) > return -EINVAL; > > tables = kcalloc(SMU_TABLE_COUNT, sizeof(struct smu_table), @@ - > 465,13 +465,12 @@ static int smu_v11_0_fini_smc_tables(struct > smu_context *smu) > struct smu_table_context *smu_table = &smu->smu_table; > int ret = 0; > > - if (!smu_table->tables || smu_table->table_count == 0) > + if (!smu_table->tables) > return -EINVAL; > > kfree(smu_table->tables); > kfree(smu_table->metrics_table); > smu_table->tables = NULL; > - smu_table->table_count = 0; > smu_table->metrics_table = NULL; > smu_table->metrics_time = 0; > > diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c > b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c > index 899bf96b23e1..68548ba9b6ea 100644 > --- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c > +++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c > @@ -3189,5 +3189,4 @@ void vega20_set_ppt_funcs(struct smu_context > *smu) > struct smu_table_context *smu_table = &smu->smu_table; > > smu->ppt_funcs = &vega20_ppt_funcs; > - smu_table->table_count = TABLE_COUNT; > } > -- > 2.22.0 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ------------------------------ Subject: Digest Footer _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx ------------------------------ End of amd-gfx Digest, Vol 40, Issue 37 *************************************** |
_______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx