Re: [PATCH] drm/amdgpu/display: fix wrong enum type for ddc_result

2018-02-04 Thread kbuild test robot
Hi Dominik,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.15]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/dbehr-chromium-org/drm-amdgpu-display-fix-wrong-enum-type-for-ddc_result/20180204-073608
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


vim +1945 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c

4562236b3b Harry Wentland 2017-09-12  1924  
d0778ebfd5 Harry Wentland 2017-07-22  1925  bool 
dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data 
*out_hpd_irq_dpcd_data)
4562236b3b Harry Wentland 2017-09-12  1926  {
4562236b3b Harry Wentland 2017-09-12  1927  union hpd_irq_data 
hpd_irq_dpcd_data = 0;
c2e218dda0 Harry Wentland 2017-02-24  1928  union device_service_irq 
device_service_clear = { { 0 } };
4935e2b954 Dominik Behr   2018-02-01  1929  enum ddc_result result = 
DDC_RESULT_UNKNOWN;
4562236b3b Harry Wentland 2017-09-12  1930  bool status = false;
4562236b3b Harry Wentland 2017-09-12  1931  /* For use cases related to 
down stream connection status change,
4562236b3b Harry Wentland 2017-09-12  1932   * PSR and device auto test, 
refer to function handle_sst_hpd_irq
4562236b3b Harry Wentland 2017-09-12  1933   * in DAL2.1*/
4562236b3b Harry Wentland 2017-09-12  1934  
4562236b3b Harry Wentland 2017-09-12  1935  
dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
4562236b3b Harry Wentland 2017-09-12  1936  "%s: Got short pulse 
HPD on link %d\n",
d0778ebfd5 Harry Wentland 2017-07-22  1937  __func__, 
link->link_index);
4562236b3b Harry Wentland 2017-09-12  1938  
8ee65d7c93 Wenjing Liu2017-07-19  1939  
4562236b3b Harry Wentland 2017-09-12  1940   /* All the 
"handle_hpd_irq_xxx()" methods
4562236b3b Harry Wentland 2017-09-12  1941   * should be called 
only after
4562236b3b Harry Wentland 2017-09-12  1942   * 
dal_dpsst_ls_read_hpd_irq_data
4562236b3b Harry Wentland 2017-09-12  1943   * Order of calls is 
important too
4562236b3b Harry Wentland 2017-09-12  1944   */
4562236b3b Harry Wentland 2017-09-12 @1945  result = 
read_hpd_rx_irq_data(link, _irq_dpcd_data);
8ee65d7c93 Wenjing Liu2017-07-19  1946  if (out_hpd_irq_dpcd_data)
8ee65d7c93 Wenjing Liu2017-07-19  1947  *out_hpd_irq_dpcd_data 
= hpd_irq_dpcd_data;
4562236b3b Harry Wentland 2017-09-12  1948  
4935e2b954 Dominik Behr   2018-02-01  1949  if (result != 
DDC_RESULT_SUCCESSFUL) {
4562236b3b Harry Wentland 2017-09-12  1950  
dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
4562236b3b Harry Wentland 2017-09-12  1951  "%s: DPCD read 
failed to obtain irq data\n",
4562236b3b Harry Wentland 2017-09-12  1952  __func__);
4562236b3b Harry Wentland 2017-09-12  1953  return false;
4562236b3b Harry Wentland 2017-09-12  1954  }
4562236b3b Harry Wentland 2017-09-12  1955  
4562236b3b Harry Wentland 2017-09-12  1956  if 
(hpd_irq_dpcd_data.bytes.device_service_irq.bits.AUTOMATED_TEST) {
4562236b3b Harry Wentland 2017-09-12  1957  
device_service_clear.bits.AUTOMATED_TEST = 1;
4562236b3b Harry Wentland 2017-09-12  1958  core_link_write_dpcd(
4562236b3b Harry Wentland 2017-09-12  1959  link,
3a340294f7 Dave Airlie2016-12-13  1960  
DP_DEVICE_SERVICE_IRQ_VECTOR,
4562236b3b Harry Wentland 2017-09-12  1961  
_service_clear.raw,
4562236b3b Harry Wentland 2017-09-12  1962  
sizeof(device_service_clear.raw));
4562236b3b Harry Wentland 2017-09-12  1963  
device_service_clear.raw = 0;
4562236b3b Harry Wentland 2017-09-12  1964  
handle_automated_test(link);
4562236b3b Harry Wentland 2017-09-12  1965  return false;
4562236b3b Harry Wentland 2017-09-12  1966  }
4562236b3b Harry Wentland 2017-09-12  1967  
4562236b3b Harry Wentland 2017-09-12  1968  if (!allow_hpd_rx_irq(link)) {
4562236b3b Harry Wentland 2017-09-12  1969  
dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
4562236b3b Harry Wentland 2017-09-12  1970  "%s: skipping 
HPD handling on %d\n",
d0778ebfd5 Harry Wentland 2017-07-22  1971  __func__, 
link->link_index);
4562236b3b Harry Wentland 2017-09-12  1972  return false;
4562236b3b Harry Wentland 2017-09-12  1973  }
4562236b3b Harry Wentland 2017-09-12  1974  
4562236b3b Harry Wentland 2017-09-12  1975  if 
(handle_hpd_irq_psr_sink(link))
4562236b3b Harry Wentland 2017-09-12  1976  /* PSR-related error 
was detected and handled */
4562236b3b Harry 

Re: [PATCH] drm/amdgpu/display: fix wrong enum type for ddc_result

2018-02-03 Thread kbuild test robot
Hi Dominik,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.15 next-20180202]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/dbehr-chromium-org/drm-amdgpu-display-fix-wrong-enum-type-for-ddc_result/20180204-091310
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: x86_64-randconfig-s3-02041012 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/uapi/linux/swab.h:6:0,
from include/linux/swab.h:5,
from include/uapi/linux/byteorder/little_endian.h:13,
from include/linux/byteorder/little_endian.h:5,
from arch/x86/include/uapi/asm/byteorder.h:5,
from drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:29,
from 
drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:29,
from 
drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
from 
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:2:
   drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 
'dc_link_handle_hpd_rx_irq':
   drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1949:13: warning: 
comparison between 'enum ddc_result' and 'enum dc_status' [-Wenum-compare]
 if (result != DC_OK) {
^
   include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
 if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
 ^~~~
>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1949:2: note: in 
>> expansion of macro 'if'
 if (result != DC_OK) {
 ^~
   drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1949:13: warning: 
comparison between 'enum ddc_result' and 'enum dc_status' [-Wenum-compare]
 if (result != DC_OK) {
^
   include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
 if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
 ^~~~
>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1949:2: note: in 
>> expansion of macro 'if'
 if (result != DC_OK) {
 ^~
   drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1949:13: warning: 
comparison between 'enum ddc_result' and 'enum dc_status' [-Wenum-compare]
 if (result != DC_OK) {
^
   include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
  __r = !!(cond); \
   ^~~~
>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1949:2: note: in 
>> expansion of macro 'if'
 if (result != DC_OK) {
 ^~

vim +/if +1949 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c

4562236b3b Harry Wentland 2017-09-12  1924  
d0778ebfd5 Harry Wentland 2017-07-22  1925  bool 
dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data 
*out_hpd_irq_dpcd_data)
4562236b3b Harry Wentland 2017-09-12  1926  {
4562236b3b Harry Wentland 2017-09-12  1927  union hpd_irq_data 
hpd_irq_dpcd_data = 0;
c2e218dda0 Harry Wentland 2017-02-24  1928  union device_service_irq 
device_service_clear = { { 0 } };
698569c574 Dominik Behr   2018-02-01  1929  enum ddc_result result = 
DDC_RESULT_UNKNOWN;
4562236b3b Harry Wentland 2017-09-12  1930  bool status = false;
4562236b3b Harry Wentland 2017-09-12  1931  /* For use cases related to 
down stream connection status change,
4562236b3b Harry Wentland 2017-09-12  1932   * PSR and device auto test, 
refer to function handle_sst_hpd_irq
4562236b3b Harry Wentland 2017-09-12  1933   * in DAL2.1*/
4562236b3b Harry Wentland 2017-09-12  1934  
4562236b3b Harry Wentland 2017-09-12  1935  
dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
4562236b3b Harry Wentland 2017-09-12  1936  "%s: Got short pulse 
HPD on link %d\n",
d0778ebfd5 Harry Wentland 2017-07-22  1937  __func__, 
link->link_index);
4562236b3b Harry Wentland 2017-09-12  1938  
8ee65d7c93 Wenjing Liu2017-07-19  1939  
4562236b3b Harry Wentland 2017-09-12  1940   /* All the 
"handle_hpd_irq_xxx()" methods
4562236b3b Harry Wentland 2017-09-12  1941   * should be called 
only after
4562236b3b Harry Wentland 2017-09-12  1942   * 
dal_dpsst_ls_read_hpd_irq_data
4562236b3b Harry Wentland 2017-09-12  1943   * Order of calls is 
important too
4562236b3b Harry Wentland 2017-09-12  1944   */
4562236b3b Harry Wentland 2017-09-12  1945  result = 
read_hpd_rx_irq_data(link, _irq_dpcd_data);
8ee65d7c93 Wenjing Liu2017-07-19  1946  if (out_hpd_irq_dpcd_data)
8ee65d7c93 

Re: [PATCH] drm/amdgpu/display: fix wrong enum type for ddc_result

2018-02-03 Thread kbuild test robot
Hi Dominik,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.15]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/dbehr-chromium-org/drm-amdgpu-display-fix-wrong-enum-type-for-ddc_result/20180204-091310
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=ia64 

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 
'dc_link_handle_hpd_rx_irq':
>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1949:13: warning: 
>> comparison between 'enum ddc_result' and 'enum dc_status' [-Wenum-compare]
 if (result != DC_OK) {
^~

vim +1949 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c

4562236b3b Harry Wentland 2017-09-12  1924  
d0778ebfd5 Harry Wentland 2017-07-22  1925  bool 
dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data 
*out_hpd_irq_dpcd_data)
4562236b3b Harry Wentland 2017-09-12  1926  {
4562236b3b Harry Wentland 2017-09-12  1927  union hpd_irq_data 
hpd_irq_dpcd_data = 0;
c2e218dda0 Harry Wentland 2017-02-24  1928  union device_service_irq 
device_service_clear = { { 0 } };
698569c574 Dominik Behr   2018-02-01  1929  enum ddc_result result = 
DDC_RESULT_UNKNOWN;
4562236b3b Harry Wentland 2017-09-12  1930  bool status = false;
4562236b3b Harry Wentland 2017-09-12  1931  /* For use cases related to 
down stream connection status change,
4562236b3b Harry Wentland 2017-09-12  1932   * PSR and device auto test, 
refer to function handle_sst_hpd_irq
4562236b3b Harry Wentland 2017-09-12  1933   * in DAL2.1*/
4562236b3b Harry Wentland 2017-09-12  1934  
4562236b3b Harry Wentland 2017-09-12  1935  
dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
4562236b3b Harry Wentland 2017-09-12  1936  "%s: Got short pulse 
HPD on link %d\n",
d0778ebfd5 Harry Wentland 2017-07-22  1937  __func__, 
link->link_index);
4562236b3b Harry Wentland 2017-09-12  1938  
8ee65d7c93 Wenjing Liu2017-07-19  1939  
4562236b3b Harry Wentland 2017-09-12  1940   /* All the 
"handle_hpd_irq_xxx()" methods
4562236b3b Harry Wentland 2017-09-12  1941   * should be called 
only after
4562236b3b Harry Wentland 2017-09-12  1942   * 
dal_dpsst_ls_read_hpd_irq_data
4562236b3b Harry Wentland 2017-09-12  1943   * Order of calls is 
important too
4562236b3b Harry Wentland 2017-09-12  1944   */
4562236b3b Harry Wentland 2017-09-12  1945  result = 
read_hpd_rx_irq_data(link, _irq_dpcd_data);
8ee65d7c93 Wenjing Liu2017-07-19  1946  if (out_hpd_irq_dpcd_data)
8ee65d7c93 Wenjing Liu2017-07-19  1947  *out_hpd_irq_dpcd_data 
= hpd_irq_dpcd_data;
4562236b3b Harry Wentland 2017-09-12  1948  
4562236b3b Harry Wentland 2017-09-12 @1949  if (result != DC_OK) {
4562236b3b Harry Wentland 2017-09-12  1950  
dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
4562236b3b Harry Wentland 2017-09-12  1951  "%s: DPCD read 
failed to obtain irq data\n",
4562236b3b Harry Wentland 2017-09-12  1952  __func__);
4562236b3b Harry Wentland 2017-09-12  1953  return false;
4562236b3b Harry Wentland 2017-09-12  1954  }
4562236b3b Harry Wentland 2017-09-12  1955  
4562236b3b Harry Wentland 2017-09-12  1956  if 
(hpd_irq_dpcd_data.bytes.device_service_irq.bits.AUTOMATED_TEST) {
4562236b3b Harry Wentland 2017-09-12  1957  
device_service_clear.bits.AUTOMATED_TEST = 1;
4562236b3b Harry Wentland 2017-09-12  1958  core_link_write_dpcd(
4562236b3b Harry Wentland 2017-09-12  1959  link,
3a340294f7 Dave Airlie2016-12-13  1960  
DP_DEVICE_SERVICE_IRQ_VECTOR,
4562236b3b Harry Wentland 2017-09-12  1961  
_service_clear.raw,
4562236b3b Harry Wentland 2017-09-12  1962  
sizeof(device_service_clear.raw));
4562236b3b Harry Wentland 2017-09-12  1963  
device_service_clear.raw = 0;
4562236b3b Harry Wentland 2017-09-12  1964  
handle_automated_test(link);
4562236b3b Harry Wentland 2017-09-12  1965  return false;
4562236b3b Harry Wentland 2017-09-12  1966  }
4562236b3b Harry Wentland 2017-09-12  1967  
4562236b3b Harry Wentland 2017-09-12  1968  if (!allow_hpd_rx_irq(link)) {
4562236b3b Harry Wentland 2017-09-12  1969  
dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
4562236b3b Harry Wentland 

Re: [PATCH] drm/amdgpu/display: fix wrong enum type for ddc_result

2018-02-02 Thread Dominik Behr
Aww, you are right. Let me redo it and do the spelling fix separately
because I cannot unsee it now.

On Fri, Feb 2, 2018 at 7:48 AM, Harry Wentland  wrote:
> On 2018-02-01 08:55 PM, db...@chromium.org wrote:
>> From: Dominik Behr 
>>
>> v2: now with fixed result comparison and spelling fixes
>>
>> Signed-off-by: Dominik Behr 
>> ---
>>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
>>  drivers/gpu/drm/amd/display/dc/core/dc_link.c   | 2 +-
>>  drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c   | 4 ++--
>>  drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c| 4 ++--
>>  drivers/gpu/drm/amd/display/include/ddc_service_types.h | 2 +-
>>  5 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c 
>> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> index 1e8a21b67df7..3b05900d 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> @@ -130,7 +130,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
>>msg->address,
>>msg->buffer,
>>msg->size,
>> -  r == DDC_RESULT_SUCESSFULL);
>> +  r == DDC_RESULT_SUCCESSFUL);
>>  #endif
>>
>>   return msg->size;
>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c 
>> b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
>> index 0023754e034b..3abd0f1a287f 100644
>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
>> @@ -1176,7 +1176,7 @@ static void dpcd_configure_panel_mode(
>>   _config_set.raw,
>>   sizeof(edp_config_set.raw));
>>
>> - ASSERT(result == DDC_RESULT_SUCESSFULL);
>> + ASSERT(result == DDC_RESULT_SUCCESSFUL);
>>   }
>>   }
>>   dm_logger_write(link->ctx->logger, LOG_DETECTION_DP_CAPS,
>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c 
>> b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
>> index d5294798b0a5..6b69b339dba2 100644
>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
>> @@ -661,7 +661,7 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
>>   ddc->ctx->i2caux,
>>   ddc->ddc_pin,
>>   ))
>> - return DDC_RESULT_SUCESSFULL;
>> + return DDC_RESULT_SUCCESSFUL;
>>
>>   return DDC_RESULT_FAILED_OPERATION;
>>  }
>> @@ -698,7 +698,7 @@ enum ddc_result dal_ddc_service_write_dpcd_data(
>>   ddc->ctx->i2caux,
>>   ddc->ddc_pin,
>>   ))
>> - return DDC_RESULT_SUCESSFULL;
>> + return DDC_RESULT_SUCCESSFUL;
>>
>>   return DDC_RESULT_FAILED_OPERATION;
>>  }
>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c 
>> b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> index 33d91e4474ea..cc067d04505d 100644
>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> @@ -1926,7 +1926,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, 
>> union hpd_irq_data *out_hpd
>>  {
>>   union hpd_irq_data hpd_irq_dpcd_data = 0;
>>   union device_service_irq device_service_clear = { { 0 } };
>> - enum dc_status result = DDC_RESULT_UNKNOWN;
>> + enum ddc_result result = DDC_RESULT_UNKNOWN;
>
> Result gets the return value from read_hpd_rx_irq_data which is dc_status. 
> This line should be
>
> enum dc_status result = DC_OK;
>
>>   bool status = false;
>>   /* For use cases related to down stream connection status change,
>>* PSR and device auto test, refer to function handle_sst_hpd_irq
>> @@ -1946,7 +1946,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, 
>> union hpd_irq_data *out_hpd
>>   if (out_hpd_irq_dpcd_data)
>>   *out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
>>
>> - if (result != DC_OK) {
>> + if (result != DDC_RESULT_SUCCESSFUL) {
>
> We should keep the result != DC_OK check here as read_hpd_rx_irq_data returns 
> dc_status.
>
> Harry
>
>>   dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
>>   "%s: DPCD read failed to obtain irq data\n",
>>   __func__);
>> diff --git a/drivers/gpu/drm/amd/display/include/ddc_service_types.h 
>> b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
>> index 019e7a095ea1..f3bf749b3636 100644
>> --- a/drivers/gpu/drm/amd/display/include/ddc_service_types.h
>> +++ b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
>> @@ -32,7 +32,7 @@
>>
>>  enum ddc_result {
>>   DDC_RESULT_UNKNOWN = 0,
>> - DDC_RESULT_SUCESSFULL,
>> + DDC_RESULT_SUCCESSFUL,
>>   

Re: [PATCH] drm/amdgpu/display: fix wrong enum type for ddc_result

2018-02-02 Thread Harry Wentland
On 2018-02-01 08:55 PM, db...@chromium.org wrote:
> From: Dominik Behr 
> 
> v2: now with fixed result comparison and spelling fixes
> 
> Signed-off-by: Dominik Behr 
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c   | 2 +-
>  drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c   | 4 ++--
>  drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c| 4 ++--
>  drivers/gpu/drm/amd/display/include/ddc_service_types.h | 2 +-
>  5 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index 1e8a21b67df7..3b05900d 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -130,7 +130,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
>msg->address,
>msg->buffer,
>msg->size,
> -  r == DDC_RESULT_SUCESSFULL);
> +  r == DDC_RESULT_SUCCESSFUL);
>  #endif
>  
>   return msg->size;
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c 
> b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index 0023754e034b..3abd0f1a287f 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -1176,7 +1176,7 @@ static void dpcd_configure_panel_mode(
>   _config_set.raw,
>   sizeof(edp_config_set.raw));
>  
> - ASSERT(result == DDC_RESULT_SUCESSFULL);
> + ASSERT(result == DDC_RESULT_SUCCESSFUL);
>   }
>   }
>   dm_logger_write(link->ctx->logger, LOG_DETECTION_DP_CAPS,
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c 
> b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> index d5294798b0a5..6b69b339dba2 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> @@ -661,7 +661,7 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
>   ddc->ctx->i2caux,
>   ddc->ddc_pin,
>   ))
> - return DDC_RESULT_SUCESSFULL;
> + return DDC_RESULT_SUCCESSFUL;
>  
>   return DDC_RESULT_FAILED_OPERATION;
>  }
> @@ -698,7 +698,7 @@ enum ddc_result dal_ddc_service_write_dpcd_data(
>   ddc->ctx->i2caux,
>   ddc->ddc_pin,
>   ))
> - return DDC_RESULT_SUCESSFULL;
> + return DDC_RESULT_SUCCESSFUL;
>  
>   return DDC_RESULT_FAILED_OPERATION;
>  }
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c 
> b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> index 33d91e4474ea..cc067d04505d 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> @@ -1926,7 +1926,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, 
> union hpd_irq_data *out_hpd
>  {
>   union hpd_irq_data hpd_irq_dpcd_data = 0;
>   union device_service_irq device_service_clear = { { 0 } };
> - enum dc_status result = DDC_RESULT_UNKNOWN;
> + enum ddc_result result = DDC_RESULT_UNKNOWN;

Result gets the return value from read_hpd_rx_irq_data which is dc_status. This 
line should be

enum dc_status result = DC_OK;

>   bool status = false;
>   /* For use cases related to down stream connection status change,
>* PSR and device auto test, refer to function handle_sst_hpd_irq
> @@ -1946,7 +1946,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, 
> union hpd_irq_data *out_hpd
>   if (out_hpd_irq_dpcd_data)
>   *out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
>  
> - if (result != DC_OK) {
> + if (result != DDC_RESULT_SUCCESSFUL) {

We should keep the result != DC_OK check here as read_hpd_rx_irq_data returns 
dc_status.

Harry

>   dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
>   "%s: DPCD read failed to obtain irq data\n",
>   __func__);
> diff --git a/drivers/gpu/drm/amd/display/include/ddc_service_types.h 
> b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> index 019e7a095ea1..f3bf749b3636 100644
> --- a/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> +++ b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> @@ -32,7 +32,7 @@
>  
>  enum ddc_result {
>   DDC_RESULT_UNKNOWN = 0,
> - DDC_RESULT_SUCESSFULL,
> + DDC_RESULT_SUCCESSFUL,
>   DDC_RESULT_FAILED_CHANNEL_BUSY,
>   DDC_RESULT_FAILED_TIMEOUT,
>   DDC_RESULT_FAILED_PROTOCOL_ERROR,
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/amdgpu/display: fix wrong enum type for ddc_result

2018-02-02 Thread Michel Dänzer

Adding the amd-gfx list, please always send amdgpu patches there.


On 2018-02-02 02:55 AM, db...@chromium.org wrote:
> From: Dominik Behr 
> 
> v2: now with fixed result comparison and spelling fixes
> 
> Signed-off-by: Dominik Behr 
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c   | 2 +-
>  drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c   | 4 ++--
>  drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c| 4 ++--
>  drivers/gpu/drm/amd/display/include/ddc_service_types.h | 2 +-
>  5 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index 1e8a21b67df7..3b05900d 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -130,7 +130,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
>msg->address,
>msg->buffer,
>msg->size,
> -  r == DDC_RESULT_SUCESSFULL);
> +  r == DDC_RESULT_SUCCESSFUL);
>  #endif
>  
>   return msg->size;
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c 
> b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index 0023754e034b..3abd0f1a287f 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -1176,7 +1176,7 @@ static void dpcd_configure_panel_mode(
>   _config_set.raw,
>   sizeof(edp_config_set.raw));
>  
> - ASSERT(result == DDC_RESULT_SUCESSFULL);
> + ASSERT(result == DDC_RESULT_SUCCESSFUL);
>   }
>   }
>   dm_logger_write(link->ctx->logger, LOG_DETECTION_DP_CAPS,
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c 
> b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> index d5294798b0a5..6b69b339dba2 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> @@ -661,7 +661,7 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
>   ddc->ctx->i2caux,
>   ddc->ddc_pin,
>   ))
> - return DDC_RESULT_SUCESSFULL;
> + return DDC_RESULT_SUCCESSFUL;
>  
>   return DDC_RESULT_FAILED_OPERATION;
>  }
> @@ -698,7 +698,7 @@ enum ddc_result dal_ddc_service_write_dpcd_data(
>   ddc->ctx->i2caux,
>   ddc->ddc_pin,
>   ))
> - return DDC_RESULT_SUCESSFULL;
> + return DDC_RESULT_SUCCESSFUL;
>  
>   return DDC_RESULT_FAILED_OPERATION;
>  }
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c 
> b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> index 33d91e4474ea..cc067d04505d 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> @@ -1926,7 +1926,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, 
> union hpd_irq_data *out_hpd
>  {
>   union hpd_irq_data hpd_irq_dpcd_data = 0;
>   union device_service_irq device_service_clear = { { 0 } };
> - enum dc_status result = DDC_RESULT_UNKNOWN;
> + enum ddc_result result = DDC_RESULT_UNKNOWN;
>   bool status = false;
>   /* For use cases related to down stream connection status change,
>* PSR and device auto test, refer to function handle_sst_hpd_irq
> @@ -1946,7 +1946,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, 
> union hpd_irq_data *out_hpd
>   if (out_hpd_irq_dpcd_data)
>   *out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
>  
> - if (result != DC_OK) {
> + if (result != DDC_RESULT_SUCCESSFUL) {
>   dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
>   "%s: DPCD read failed to obtain irq data\n",
>   __func__);
> diff --git a/drivers/gpu/drm/amd/display/include/ddc_service_types.h 
> b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> index 019e7a095ea1..f3bf749b3636 100644
> --- a/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> +++ b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> @@ -32,7 +32,7 @@
>  
>  enum ddc_result {
>   DDC_RESULT_UNKNOWN = 0,
> - DDC_RESULT_SUCESSFULL,
> + DDC_RESULT_SUCCESSFUL,
>   DDC_RESULT_FAILED_CHANNEL_BUSY,
>   DDC_RESULT_FAILED_TIMEOUT,
>   DDC_RESULT_FAILED_PROTOCOL_ERROR,
> 


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel